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

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
}

.settings-panel fieldset {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.settings-panel legend {
  padding: 0 6px;
  font-weight: 700;
}

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

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.check-row small {
  color: var(--muted);
}

* {
  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;
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.topbar-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar-brand strong {
  white-space: nowrap;
}

.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);
}

.topbar-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--ink);
  line-height: 1;
}

.topbar-menu-button::before {
  content: "☰";
  font-size: 24px;
  font-weight: 800;
}

.topbar[data-menu-open="1"] .topbar-menu-button::before {
  content: "×";
  font-size: 28px;
}

.layout {
  padding: 24px;
}

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

.material-head {
  align-items: center;
  gap: 18px;
}

.material-head-main {
  min-width: 0;
  flex: 1;
}

.material-head-side {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
}

.material-storage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.material-storage-card {
  min-width: min(100%, 270px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: white;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.material-head-side .material-storage-summary {
  margin-top: 0;
  justify-content: flex-end;
}

.material-storage-card > strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.material-storage-card dl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
}

.material-storage-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.material-storage-card dd {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.material-storage-meter {
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  background: color-mix(in srgb, var(--line) 70%, white);
}

.material-storage-meter span {
  display: block;
  height: 100%;
  background: var(--blue);
}

.material-storage-card[data-tone="warn"] .material-storage-meter span {
  background: #b7791f;
}

.material-storage-card[data-tone="over"] .material-storage-meter span {
  background: var(--red);
}

.material-icon-panel {
  align-content: start;
}

.material-icon-preview {
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--blue) 7%, white);
}

.material-icon-preview img,
.material-icon-preview canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

.material-icon-preview canvas {
  cursor: grab;
  touch-action: none;
}

.material-icon-preview canvas:active {
  cursor: grabbing;
}

.material-icon-preview span {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-weight: 900;
}

.material-icon-zoom {
  display: grid;
  gap: 6px;
  max-width: 260px;
  font-size: 0.88rem;
  color: var(--muted);
}

.material-create-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.material-create-form select {
  width: min(220px, 42vw);
  min-height: 40px;
}

.material-create-form button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border-radius: 999px;
  font-size: 30px;
  line-height: 1;
}

.material-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.material-add-menu {
  position: relative;
}

.material-add-menu summary {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: 31px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  list-style: none;
}

.material-add-menu summary::-webkit-details-marker {
  display: none;
}

.material-add-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  display: grid;
  width: min(540px, calc(100vw - 32px));
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.material-add-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 72%, white);
}

.material-add-tabs button {
  min-height: 38px;
  padding: 8px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.material-add-tabs button[aria-pressed="true"] {
  border-color: var(--line);
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.material-add-pane[hidden] {
  display: none;
}

.material-add-panel form {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
}

.material-add-panel h2 {
  margin: 0;
  font-size: 15px;
}

.material-add-panel label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.material-add-panel textarea,
.field-upload-comment textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
}

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);
}

.preset-icon-thumb {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.preset-icon-button {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.preset-icon-button span {
  line-height: 1.15;
  text-align: center;
}

.preset-icon-button:hover,
.preset-icon-button:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

.preset-icon-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.46);
}

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

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

.preset-icon-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preset-icon-head h2 {
  margin: 0;
}

.preset-icon-head button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

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

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

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

.preset-icon-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;
}

.preset-icon-crop-canvas:active {
  cursor: grabbing;
}

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

#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;
}

.preset-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.6fr);
  gap: 16px;
  align-items: start;
}

.preset-folder-grid,
.preset-item-grid {
  display: grid;
  gap: 12px;
}

.preset-folder-card,
.preset-item-card {
  background: var(--panel);
  border: 1px solid var(--line);
}

.preset-folder-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.preset-folder-card.is-selected {
  border-color: var(--blue);
  box-shadow: inset 4px 0 0 var(--blue), 0 0 0 1px rgba(32, 120, 255, 0.12);
}

.preset-folder-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid #cfe0f7;
  background: #eef6ff;
  color: var(--ink);
}

.preset-folder-main:hover,
.preset-folder-main:focus-visible {
  border-color: var(--blue);
  background: #e2f0ff;
}

.preset-folder-card.is-selected .preset-folder-main {
  border-color: var(--blue);
  background: #dcebff;
}

.preset-folder-open {
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  color: inherit;
  text-decoration: none;
}

.preset-folder-main h2,
.preset-item-title h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
}

.preset-folder-main p,
.preset-item-body p {
  overflow: hidden;
  margin-top: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-folder-name-display,
.preset-folder-description-display {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  cursor: text;
}

.preset-folder-name-display:hover .folder-name-edit-button,
.preset-folder-name-display:focus-visible .folder-name-edit-button,
.preset-folder-description-display:hover .folder-name-edit-button,
.preset-folder-description-display:focus-visible .folder-name-edit-button {
  opacity: 1;
}

.preset-folder-name-form,
.preset-folder-description-form {
  display: grid;
  gap: 8px;
}

.preset-folder-name-form[hidden],
.preset-folder-description-form[hidden] {
  display: none;
}

.preset-folder-name-form label,
.preset-folder-description-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.preset-folder-name-form input,
.preset-folder-description-form input {
  width: 100%;
  min-width: 0;
}

.preset-folder-name-form button,
.preset-folder-description-form button {
  justify-self: start;
  min-height: 32px;
  padding: 0 12px;
}

.preset-folder-mark {
  position: relative;
  width: 44px;
  height: 34px;
  align-self: start;
  margin-top: 4px;
  border: 1px solid #c9d8ea;
  border-radius: 6px;
  background: #eef6ff;
}

.preset-folder-mark::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 6px;
  width: 20px;
  height: 10px;
  border: 1px solid #c9d8ea;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: #eef6ff;
}

.preset-folder-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 0;
}

.preset-folder-stats div {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.preset-folder-stats dt {
  color: var(--muted);
  font-size: 12px;
}

.preset-folder-stats dd {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.preset-folder-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.preset-folder-actions > form > button,
.preset-item-actions button {
  min-height: 34px;
  padding: 0 12px;
}

.preset-item-card {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.preset-item-settings {
  position: static;
  border-color: var(--line);
  background: var(--ink);
}

.preset-item-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.preset-item-actions form {
  margin: 0;
}

.preset-settings-icon-preview {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
}

.preset-settings-icon-preview .preset-icon-button {
  width: 64px;
  height: 64px;
  min-height: 64px;
}

.preset-item-thumb {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
}

.preset-item-thumb .preset-icon-button {
  width: 56px;
  height: 56px;
  min-height: 56px;
}

.preset-item-thumb .preset-icon-thumb {
  width: 46px;
  height: 46px;
}

.preset-item-thumb[data-kind="web"],
.preset-item-thumb[data-kind="url"] {
  background: #eef7f4;
  color: var(--green);
}

.preset-item-thumb[data-kind="app"],
.preset-item-thumb[data-kind="console-app"] {
  background: #f4f0ff;
  color: #5f4b9b;
}

.preset-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.preset-item-title h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-item-body small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.preset-edit-grid {
  margin-top: 18px;
}

.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-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: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

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

.launcher-display-panel p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

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

.launcher-sync-mode,
.launcher-sync-targets {
  display: grid;
  gap: 8px;
}

.launcher-sync-mode label,
.launcher-sync-targets label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.launcher-materials-link-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.launcher-materials-link-panel h3,
.launcher-materials-link-panel p {
  margin: 0;
}

.launcher-materials-link-panel p {
  color: var(--muted);
  font-size: 13px;
}

.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-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.launcher-item-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.launcher-item-card {
  position: relative;
  border-radius: 8px;
}

.launcher-card-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  justify-content: space-between;
}

.launcher-admin-badge,
.order-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.launcher-admin-badge {
  margin-right: auto;
  color: var(--ink);
}

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

.launcher-card-drag {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 900;
  cursor: grab;
  user-select: none;
}

.launcher-card-drag:active {
  cursor: grabbing;
}

.launcher-admin-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  color: var(--ink);
}

.launcher-admin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.launcher-admin-thumb > span {
  font-size: 34px;
  font-weight: 850;
}

.launcher-admin-thumb-icon img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.launcher-admin-thumb-folder {
  background: linear-gradient(135deg, #dbeafe, #f8fafc);
}

.launcher-admin-thumb-folder span {
  width: min(68%, 128px);
  height: min(58%, 88px);
  position: relative;
  border-radius: 10px;
  background: #2563eb;
  box-shadow: inset 0 -18px 0 rgba(15, 23, 42, 0.12);
  overflow: visible;
}

.launcher-admin-thumb-folder span::before {
  content: "";
  position: absolute;
  left: 10px;
  top: -12px;
  z-index: 3;
  width: 38px;
  height: 18px;
  border-radius: 8px 8px 0 0;
  background: #60a5fa;
}

.launcher-admin-thumb-folder span::after {
  content: "";
  position: absolute;
  inset: 52% 0 0;
  z-index: 2;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.launcher-admin-thumb-folder img,
.launcher-admin-thumb-folder i {
  position: absolute;
  inset: 16px 10px 14px;
  z-index: 1;
  width: auto;
  height: auto;
  border-radius: 7px;
}

.launcher-admin-thumb-folder img {
  width: calc(100% - 20px);
  height: calc(100% - 30px);
  object-fit: cover;
}

.launcher-admin-thumb-folder i {
  display: block;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.76), rgba(255,255,255,0.12)),
    linear-gradient(135deg, #9cc3ff 0 48%, #facc15 49% 60%, #22c55e 61% 100%);
}

.launcher-card-summary {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.launcher-card-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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;
}

.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);
  justify-content: center;
}

.login button:disabled {
  cursor: progress;
  opacity: 0.86;
}

@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;
  }

  .preset-workspace,
  .preset-item-card {
    grid-template-columns: 1fr;
  }

  .preset-item-card {
    align-items: start;
  }

  .preset-item-card form {
    justify-self: start;
  }
}

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

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

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #f0c36a;
  background: #fff8e8;
  color: #4b3510;
}

.impersonation-banner strong {
  display: block;
}

.impersonation-banner span {
  color: #6d5525;
}

.impersonation-banner form {
  margin: 0;
}

.impersonation-banner button {
  background: #4b3510;
  border-color: #4b3510;
}

.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-occurrence {
  display: block;
  margin-top: 3px;
  color: var(--red);
  font-size: 12px;
}

.log-payload {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.log-payload summary {
  cursor: pointer;
}

.log-payload pre {
  max-width: 720px;
  max-height: 240px;
  margin: 6px 0 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  white-space: pre-wrap;
}

.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;
}

.two-column.folder-upload-row {
  grid-template-columns: minmax(0, 1fr);
}

.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);
}

.folder-summary-card header {
  align-items: flex-start;
}

.folder-title-row {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 10px;
}

.folder-title-row p {
  margin: 3px 0 0;
}

.folder-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.folder-card-meta span {
  color: color-mix(in srgb, var(--muted) 48%, white);
}

.folder-mark {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 21px;
  margin-top: 3px;
  border: 1px solid color-mix(in srgb, var(--blue) 52%, var(--line));
  background: color-mix(in srgb, var(--blue) 18%, white);
  overflow: visible;
}

.folder-mark::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -6px;
  z-index: 3;
  width: 13px;
  height: 7px;
  border: 1px solid color-mix(in srgb, var(--blue) 52%, var(--line));
  border-bottom: 0;
  background: color-mix(in srgb, var(--blue) 18%, white);
}

.folder-mark::after {
  content: "";
  position: absolute;
  inset: 46% 0 0;
  z-index: 2;
  border-top: 1px solid color-mix(in srgb, var(--blue) 38%, white);
  background: color-mix(in srgb, var(--blue) 20%, white);
}

.folder-mark img,
.folder-mark i {
  position: absolute;
  inset: 7px 4px 4px;
  z-index: 1;
  display: block;
  border-radius: 3px;
  overflow: hidden;
}

.folder-mark img {
  width: calc(100% - 8px);
  height: calc(100% - 11px);
  object-fit: contain;
  background: white;
}

.folder-mark i {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.78), rgba(255,255,255,0.16)),
    linear-gradient(135deg, #93c5fd 0 50%, #fbbf24 51% 62%, #22c55e 63% 100%);
}

.folder-mark-large {
  width: 76px;
  height: 56px;
  margin: 0;
}

.folder-mark-large::before {
  left: 5px;
  top: -12px;
  width: 34px;
  height: 13px;
}

.folder-name-form,
.folder-description-form,
.folder-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.folder-heading {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.folder-heading h1 {
  margin: 0;
}

.folder-name-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: text;
}

.folder-description-display {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  cursor: text;
}

.folder-description-display p {
  margin: 0;
  overflow-wrap: anywhere;
}

.folder-name-edit-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.folder-name-edit-button:hover,
.folder-name-edit-button:focus-visible {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.folder-name-display:focus-visible,
.folder-description-display:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--blue) 58%, white);
  outline-offset: 3px;
}

.folder-name-form[hidden],
.folder-name-display[hidden],
.folder-description-form[hidden],
.folder-description-display[hidden] {
  display: none;
}

.folder-name-form label,
.folder-description-form label {
  display: flex;
  min-width: min(360px, 70vw);
  gap: 8px;
  align-items: center;
  margin: 0;
}

.folder-description-form {
  align-items: flex-start;
  width: 100%;
}

.folder-description-form label {
  align-items: flex-start;
  min-width: min(520px, 100%);
}

.folder-name-form label span,
.folder-description-form label span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.folder-name-form input {
  width: min(360px, 70vw);
  font-size: 18px;
  font-weight: 800;
}

.folder-description-form textarea {
  width: min(520px, 100%);
  resize: vertical;
}

.folder-name-form .button-link,
.folder-description-form .button-link {
  min-height: 40px;
  border-radius: 6px;
}

.folder-card-actions {
  justify-content: flex-end;
}

.folder-card-actions form {
  margin: 0;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.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);
}

.network-usage-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.network-usage-kpis article {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fbfcfe;
}

.network-usage-kpis article.good {
  border-color: #8fd6a3;
  background: #f2fbf5;
}

.network-usage-kpis article.warn {
  border-color: #f3c46d;
  background: #fff8e8;
}

.network-usage-kpis article.bad {
  border-color: #ee9d9d;
  background: #fff1f1;
}

.network-usage-kpis span,
.network-usage-kpis small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.network-usage-kpis strong {
  min-width: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.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;
}

.folder-upload-panel {
  gap: 14px;
}

.folder-drop-zone {
  position: relative;
  min-height: 132px;
  padding: 18px;
  border: 1px dashed color-mix(in srgb, var(--blue) 42%, var(--line));
  background: color-mix(in srgb, var(--blue) 6%, var(--panel));
  align-items: center;
  justify-items: center;
  text-align: center;
  cursor: pointer;
}

.folder-drop-zone[data-drag="1"] {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 14%, var(--panel));
  box-shadow: 0 0 0 3px rgba(32, 120, 255, 0.12);
}

.folder-drop-zone span {
  color: var(--ink);
  font-weight: 800;
}

.folder-drop-zone small {
  color: var(--muted);
}

.folder-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.folder-selected-files {
  display: grid;
  gap: 8px;
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
}

.folder-selected-files strong {
  color: var(--ink);
}

.folder-selected-files span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 80%, white);
}

.folder-selected-files span > small {
  margin-left: auto;
  white-space: nowrap;
}

.folder-selected-files button {
  width: 24px;
  min-width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
}

.folder-browser {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.material-workbench {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  align-items: start;
}

.material-library-pane {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.material-launcher-pane {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 12px;
  min-width: 0;
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.material-launcher-pane.is-drop-target {
  border-color: color-mix(in srgb, var(--blue) 70%, var(--line));
  box-shadow: inset 0 0 0 2px rgba(32, 120, 255, 0.18);
}

.material-launcher-pane.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

.material-launcher-pane-head {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.material-launcher-pane-head h2 {
  margin: 0;
  font-size: 18px;
}

.material-launcher-pane-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.material-launcher-device-select {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.material-launcher-device-select select {
  width: 100%;
}

.material-launcher-add-button {
  width: 100%;
  justify-content: center;
  border: 0;
}

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

.material-launcher-drop-hint {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px dashed color-mix(in srgb, var(--blue) 45%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.material-launcher-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 8px 10px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 74%, white);
}

.material-launcher-card.is-dragging {
  opacity: 0.58;
}

.material-launcher-card-top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.material-launcher-card-top .drag-handle {
  margin-left: auto;
  color: var(--muted);
  cursor: grab;
}

.material-launcher-delete {
  min-height: 28px;
  padding: 4px 8px;
  background: color-mix(in srgb, var(--red) 10%, white);
  color: var(--red);
  border: 1px solid color-mix(in srgb, var(--red) 22%, var(--line));
  font-size: 12px;
}

.material-launcher-card .launcher-admin-thumb {
  width: 82px;
  height: 58px;
}

.material-launcher-card > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.folder-browser-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.folder-browser-toolbar label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-right: auto;
}

.folder-browser-toolbar select {
  min-width: 210px;
}

.material-clipboard-status {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.folder-filter-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 70%, white);
}

.folder-filter-toggle button,
.folder-filter-toggle a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
  border: 0;
  text-decoration: none;
  font-weight: 700;
}

.folder-filter-toggle button[aria-pressed="true"],
.folder-filter-toggle a[aria-pressed="true"] {
  background: var(--blue);
  color: white;
}

.folder-filter-toggle span {
  opacity: 0.72;
  font-size: 12px;
}

.folder-view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 70%, white);
}

.folder-view-toggle button {
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
}

.folder-view-toggle button[aria-pressed="true"] {
  background: var(--ink);
  color: white;
}

.folder-selection-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.folder-file-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  align-items: start;
  gap: 14px;
}

.folder-file-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(130px, auto) 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.folder-file-card[draggable="true"] {
  cursor: grab;
}

.folder-file-card[draggable="true"]:active {
  cursor: grabbing;
}

.folder-file-card[hidden] {
  display: none;
}

.folder-file-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
  box-shadow: 0 0 0 1px rgba(32, 120, 255, 0.18);
}

.folder-file-select {
  position: absolute;
  top: 121px;
  right: 7px;
  bottom: auto;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.folder-file-select input {
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.folder-file-select::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.38);
}

.folder-file-select:has(input:checked)::before {
  border-color: rgba(255, 255, 255, 0.95);
  background: rgba(32, 120, 255, 0.82);
}

.folder-file-select:has(input:checked)::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.folder-file-select:has(input:focus-visible)::before {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.folder-file-select span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.folder-file-settings {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 3;
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.74);
  color: white;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.folder-file-settings:hover,
.folder-file-settings:focus-visible {
  background: var(--blue);
  color: white;
}

.folder-file-order-handle {
  position: absolute;
  top: 45px;
  right: 9px;
  z-index: 3;
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.74);
  color: white;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  cursor: grab;
}

.folder-file-order-handle:hover,
.folder-file-order-handle:focus-visible {
  background: var(--blue);
  color: white;
}

.folder-file-order-handle:active {
  cursor: grabbing;
}

.folder-file-type-badge {
  position: absolute;
  top: 121px;
  right: 34px;
  z-index: 2;
  display: inline-grid;
  min-width: 34px;
  height: 22px;
  place-items: center;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(17, 24, 39, 0.78);
  color: white;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.32);
  pointer-events: none;
}

.folder-file-card[data-tone="image"] .folder-file-type-badge {
  background: rgba(18, 128, 82, 0.86);
}

.folder-file-card[data-tone="video"] .folder-file-type-badge {
  background: rgba(107, 53, 177, 0.86);
}

.folder-file-card[data-tone="pdf"] .folder-file-type-badge {
  background: rgba(180, 35, 24, 0.88);
}

.folder-file-card[data-tone="office"] .folder-file-type-badge {
  background: rgba(27, 94, 168, 0.88);
}

.folder-file-card[data-tone="folder"] .folder-file-thumb {
  background: color-mix(in srgb, var(--blue) 10%, #f8fafc);
}

.folder-file-thumb {
  display: grid;
  min-height: 150px;
  place-items: center;
  background: color-mix(in srgb, var(--blue) 8%, #f8fafc);
  color: var(--ink);
  text-decoration: none;
}

.folder-file-thumb:hover {
  background: color-mix(in srgb, var(--blue) 12%, #f8fafc);
}

.folder-file-thumb img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.folder-file-thumb .folder-mark img,
.folder-file-thumb .folder-mark i {
  position: absolute;
  inset: 7px 4px 4px;
  z-index: 1;
  display: block;
  width: calc(100% - 8px);
  height: calc(100% - 11px);
  border-radius: 3px;
}

.folder-file-thumb .folder-mark img {
  object-fit: contain;
  background: white;
}

.folder-file-thumb .folder-mark i {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.78), rgba(255,255,255,0.16)),
    linear-gradient(135deg, #93c5fd 0 50%, #fbbf24 51% 62%, #22c55e 63% 100%);
}

.folder-file-icon {
  display: inline-grid;
  min-width: 72px;
  min-height: 72px;
  place-items: center;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
}

.folder-file-card[data-tone="pdf"] .folder-file-icon {
  color: #b42318;
}

.folder-file-card[data-tone="video"] .folder-file-icon {
  color: #6d35b1;
}

.folder-file-card[data-tone="office"] .folder-file-icon {
  color: #1b5ea8;
}

.folder-file-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}

.folder-file-meta h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  letter-spacing: 0;
}

.folder-file-meta [data-inline-rename] {
  display: inline-block;
  max-width: 100%;
  border-radius: 4px;
  cursor: text;
}

.folder-file-meta [data-inline-rename]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--blue) 58%, white);
  outline-offset: 2px;
}

.inline-rename-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.inline-rename-form input {
  width: 100%;
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
}

.inline-rename-form button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
}

.inline-rename-form[data-error="1"] input {
  border-color: var(--red);
}

.folder-file-meta h3 a {
  color: inherit;
  text-decoration: none;
}

.folder-file-meta p {
  margin: 0;
  color: var(--muted);
}

.folder-file-meta small {
  color: var(--muted);
}

.folder-conversion-status {
  color: var(--muted);
  font-weight: 700;
}

.folder-conversion-status.bad {
  color: var(--red);
}

.folder-conversion-progress {
  display: grid;
  gap: 4px;
}

.folder-conversion-progress > span {
  display: block;
  height: 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, white);
}

.folder-conversion-progress i {
  display: block;
  height: 100%;
  min-width: 6px;
  background: linear-gradient(90deg, var(--blue), #51b8ff);
}

.folder-conversion-progress small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.folder-browser[data-view="list"] .folder-file-items {
  grid-template-columns: 1fr;
}

.folder-browser[data-view="list"] .folder-file-card {
  grid-template-columns: 34px 88px minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
}

.folder-browser[data-view="list"] .material-folder-item {
  grid-template-columns: 34px 88px minmax(0, 1fr);
}

.folder-browser[data-view="list"] .folder-file-select {
  position: relative;
  top: auto;
  right: auto;
  justify-self: center;
}

.folder-browser[data-view="list"] .folder-file-type-badge {
  top: 7px;
  right: 7px;
}

.folder-browser[data-view="list"] .folder-file-thumb {
  min-height: 72px;
}

.folder-browser[data-view="list"] .folder-file-thumb img {
  height: 72px;
}

.folder-browser[data-view="list"] .folder-file-icon {
  min-width: 52px;
  min-height: 52px;
  font-size: 13px;
}

.folder-browser[data-view="list"] .folder-mark-large {
  width: 48px;
  height: 36px;
}

.folder-browser[data-view="list"] .folder-mark-large::before {
  left: 4px;
  top: -8px;
  width: 22px;
  height: 9px;
}

body[data-folder-preview="open"] {
  overflow: hidden;
}

.folder-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.58);
}

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

.folder-preview-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.32);
}

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

.folder-preview-head h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  letter-spacing: 0;
}

.folder-preview-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.folder-preview-head-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.folder-preview-head-actions a[hidden] {
  display: none;
}

.folder-preview-close {
  display: inline-grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.folder-preview-close:hover {
  background: #f1f5f9;
}

.folder-preview-body {
  display: grid;
  min-height: 280px;
  overflow: auto;
  padding: 16px;
  background: #f8fafc;
}

.folder-preview-body img,
.folder-preview-body video {
  align-self: center;
  justify-self: center;
  max-width: 100%;
  max-height: 76vh;
  background: white;
}

.folder-preview-body iframe {
  width: 100%;
  min-height: 74vh;
  border: 1px solid var(--line);
  background: white;
}

.folder-preview-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.folder-preview-note a,
.folder-preview-actions a {
  color: var(--blue);
  font-weight: 800;
}

.folder-preview-fallback {
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 12px;
  width: min(520px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  background: white;
  text-align: center;
}

.folder-preview-fallback strong {
  font-size: 18px;
}

.folder-preview-fallback p {
  margin: 0;
  color: var(--muted);
}

.folder-preview-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

@media (max-width: 720px) {
  .material-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .material-head-side {
    width: 100%;
    justify-content: space-between;
  }

  .material-head-side .material-storage-summary {
    flex: 1;
    justify-content: flex-start;
  }

  .material-storage-card {
    min-width: min(100%, 240px);
  }

  .material-workbench {
    grid-template-columns: 1fr;
  }

  .material-launcher-pane {
    position: static;
    max-height: none;
  }

  .material-add-panel {
    right: auto;
    left: 0;
    grid-template-columns: 1fr;
  }

  .folder-preview-modal {
    padding: 10px;
  }

  .folder-preview-dialog {
    width: 100%;
    max-height: 94vh;
  }

  .folder-preview-body {
    padding: 10px;
  }
}

.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: repeat(auto-fit, minmax(220px, 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 {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
}

.metric-card header strong small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

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

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

.metric-values span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.metric-values span:last-child {
  text-align: right;
}

.metric-values strong {
  color: var(--ink);
  font-size: 13px;
}

.metric-values small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.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 path.metric-line-total {
  stroke: var(--blue);
}

.metric-card path.metric-line-rx {
  stroke: #16a34a;
}

.metric-card path.metric-line-tx {
  stroke: #f97316;
}

.network-traffic-legend {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.network-traffic-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.network-traffic-legend span::before {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: var(--blue);
}

.network-traffic-legend .rx::before {
  background: #16a34a;
}

.network-traffic-legend .tx::before {
  background: #f97316;
}

.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(auto-fit, minmax(220px, 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: contain;
  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;
}

.public-material-page {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.public-material-page.gate {
  width: auto;
  margin: 0;
  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));
}

.public-material-head {
  align-items: flex-start;
  margin-bottom: 12px;
}

.public-material-notice {
  margin-bottom: 14px;
}

.field-upload-icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  box-sizing: border-box;
  color: #14532d;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid #9bd3af;
  background: #ecfdf3;
}

.field-upload-folder-icon {
  position: relative;
  width: 27px;
  height: 20px;
  display: inline-block;
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.55);
}

.field-upload-folder-icon::before {
  content: "";
  position: absolute;
  top: -8px;
  left: -2px;
  width: 13px;
  height: 8px;
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: inherit;
}

.field-upload-arrow {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-left: -14px;
  margin-top: -16px;
  color: white;
  background: #16a34a;
  border: 2px solid #ecfdf3;
  border-radius: 999px;
  font-size: 15px;
  line-height: 1;
}

.field-upload-label {
  white-space: nowrap;
}

.public-folder-items {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.public-folder-card,
.public-folder-file-card {
  color: var(--ink);
  text-decoration: none;
}

.remote-entry-page {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.05), rgba(37, 99, 235, 0.08)),
    var(--bg);
}

.remote-entry-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--remote-entry-bg, none);
  background-position: center;
  background-size: cover;
  opacity: 0.42;
  filter: saturate(1.05);
  pointer-events: none;
}

.remote-entry-page::after {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.78), rgba(235, 242, 255, 0.62));
  pointer-events: none;
}

.remote-entry-page > * {
  position: relative;
  z-index: 1;
}

.remote-entry-card {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(14px);
}

.remote-landing-page {
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.05), rgba(37, 99, 235, 0.08)),
    var(--bg);
}

.remote-landing-card {
  width: min(520px, 100%);
}

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

.remote-landing-actions a,
.remote-landing-disabled {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 14px;
  box-sizing: border-box;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.remote-landing-primary {
  display: grid !important;
  gap: 3px;
  min-height: 64px !important;
}

.remote-landing-primary strong,
.remote-landing-choice strong {
  font-size: 17px;
}

.remote-landing-primary small,
.remote-landing-choice small {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.82;
}

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

.remote-landing-choice {
  display: grid !important;
  gap: 3px;
  min-height: 58px !important;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
}

.remote-landing-disabled {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
}

.remote-landing-actions small,
.remote-landing-note {
  color: var(--muted);
  font-size: 13px;
}

.remote-landing-actions .remote-landing-primary small {
  color: rgba(255, 255, 255, 0.88);
  opacity: 1;
}

.gate-secondary-actions {
  display: grid;
}

.field-upload-card {
  width: min(560px, 100%);
}

.field-upload-form {
  display: grid;
  gap: 12px;
}

.field-upload-comment {
  display: grid;
  gap: 6px;
  color: #5c6676;
  font-size: 13px;
  font-weight: 800;
}

.field-upload-drop {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #9ab7f6;
  background: #eef4ff;
}

.field-upload-drop span {
  font-size: 18px;
  font-weight: 800;
}

.field-upload-drop input {
  width: 100%;
}

.folder-kind-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid #9ab7f6;
  background: #eef4ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}

.success-message {
  color: #047857;
  font-weight: 800;
}

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

  .public-material-page {
    width: min(100% - 18px, 100%);
    padding-top: 10px;
  }

  .public-material-head .actions {
    width: 100%;
  }

  .public-material-head .actions a {
    flex: 1 1 auto;
  }

  .public-material-head .actions .field-upload-icon-link {
    flex: 0 0 auto;
    min-width: 54px;
    padding: 9px 11px;
  }

  .public-material-head .actions .field-upload-icon-link .field-upload-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .public-folder-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .remote-landing-choice-grid {
    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="paint"] {
  grid-template-rows: auto auto minmax(180px, 1fr) auto;
}

.remote[data-view="launcher"] #pad,
.remote[data-view="launcher"] #inlinePanel,
.remote[data-view="launcher"] footer,
.remote[data-view="paint"] #launcherPanel,
.remote[data-view="paint"] #inlinePanel,
.remote[data-view="paint"] 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 footer .zoom-button {
  flex: 0.86;
  font-size: 18px;
  font-weight: 900;
}

.remote footer .zoom-reset-button {
  flex: 0.82;
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: 0;
}

.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-management-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #54657a;
  border-radius: 999px;
  background: #1f2b3d;
  color: #dbeafe;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.remote-management-link:hover,
.remote-management-link:focus-visible {
  background: #27364d;
  color: #ffffff;
  outline: none;
}

.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;
  opacity: 0.54;
}

.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;
}

.paint-panel {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #0f172a;
  overflow: hidden;
}

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

.paint-toolbar,
.paint-zoom-actions,
.paint-text-row,
.paint-actions {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.paint-toolbar {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
}

.paint-segment,
.paint-swatches,
.paint-widths,
.paint-zoom-actions,
.paint-actions {
  min-width: 0;
  display: flex;
  gap: 6px;
}

.paint-panel button {
  min-width: 0;
  min-height: 42px;
  font-size: 13px;
  font-weight: 800;
}

.paint-panel button[aria-pressed="true"] {
  background: #9ee7d7;
  border-color: #9ee7d7;
  color: #0f172a;
}

.paint-text-row {
  visibility: hidden;
  pointer-events: none;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.paint-panel[data-tool="text"] .paint-text-row {
  visibility: visible;
  pointer-events: auto;
}

.paint-text-row input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0 12px;
  background: #020617;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 800;
}

.paint-text-row input:focus {
  border-color: #9ee7d7;
  outline: 2px solid rgba(158, 231, 215, 0.18);
}

.paint-text-confirm {
  min-width: 64px;
  padding-inline: 12px;
}

.paint-panel[data-enabled="false"] .paint-toolbar,
.paint-panel[data-enabled="false"] .paint-text-row,
.paint-panel[data-enabled="false"] .paint-actions {
  opacity: 0.72;
}

.paint-swatches button {
  flex: 1 1 0;
  color: transparent;
  background:
    linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    var(--swatch, #e53935);
  border-color: rgba(255, 255, 255, 0.34);
}

.paint-swatches button[aria-pressed="true"] {
  background:
    linear-gradient(rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.06)),
    var(--swatch, #e53935);
  box-shadow:
    0 1px 0 rgba(8, 12, 22, 0.72),
    0 0 0 3px rgba(158, 231, 215, 0.22);
}

.paint-zoom-actions button {
  flex: 1 1 0;
}

.paint-zoom-actions button[data-paint-zoom="reset"] {
  flex: 1.35 1 0;
}

.paint-pad {
  position: relative;
  min-height: 220px;
  border: 1px solid #334155;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(148, 163, 184, 0.11) 25%, transparent 25%) 0 0 / 28px 28px,
    linear-gradient(135deg, transparent 75%, rgba(148, 163, 184, 0.1) 75%) 0 0 / 28px 28px,
    #111827;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.remote[data-view="paint"] .paint-pad {
  display: none;
}

.paint-pad::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(158, 231, 215, 0.18);
  border-radius: 8px;
  pointer-events: none;
}

.paint-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #cbd5e1;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
}

.paint-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.paint-message {
  min-height: 22px;
  color: #9ee7d7;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.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;
}

#pad[data-mode="paint"] {
  background:
    linear-gradient(rgba(148, 163, 184, 0.16) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(148, 163, 184, 0.16) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(158, 231, 215, 0.18) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, rgba(158, 231, 215, 0.18) 1px, transparent 1px) 0 0 / 120px 120px,
    #111827;
}

.paint-preview {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0;
  pointer-events: none;
  transform-origin: center;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

#pad[data-mode="paint"] .paint-preview.is-visible {
  opacity: 0.46;
}

#pad[data-mode="paint"].paint-snapshot-loading::before {
  content: "";
  position: absolute;
  z-index: 4;
  right: 16px;
  top: 16px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid rgba(158, 231, 215, 0.24);
  border-top-color: #9ee7d7;
  pointer-events: none;
  animation: paint-snapshot-spin 760ms linear infinite;
}

#pad[data-mode="paint"].paint-content-snapshot-loading::after {
  content: "SNAP";
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 4px solid rgba(255, 255, 255, 0.22);
  border-top-color: #ffd45a;
  border-right-color: #9ee7d7;
  background: rgba(8, 18, 22, 0.72);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  pointer-events: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  transform: translate(-50%, -50%);
  animation: paint-content-snapshot-spin 900ms linear infinite;
}

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

@keyframes paint-content-snapshot-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

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

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

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

.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-cover-frame .launcher-folder-mini-stack {
  position: absolute;
  inset: 8px;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  place-items: stretch;
  text-shadow: none;
}

.launcher-cover-frame .launcher-folder-mini-stack img {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.launcher-cover-frame .launcher-folder-mini-stack + 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;
  min-height: 222px;
  padding-bottom: 10px;
  scroll-snap-type: none;
}

.remote[data-folder-open="true"] .launcher-theater {
  overflow-x: hidden;
  pointer-events: none;
}

.remote[data-folder-open="true"] .launcher-feature,
.remote[data-folder-open="true"] .launcher-grid {
  pointer-events: none;
}

.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-folder-inline {
  margin: 8px 2px 12px;
  padding: 10px 0 12px;
  border: 1px solid rgba(158, 231, 215, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 47, 64, 0.82), rgba(14, 22, 31, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 34px rgba(0, 0, 0, 0.2);
}

.launcher-folder-inline-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px 8px;
  color: #f8fafc;
}

.launcher-folder-inline-head div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.launcher-folder-inline-head span,
.launcher-folder-inline-head small {
  color: #9ee7d7;
  font-size: 11px;
  font-weight: 900;
}

.launcher-folder-inline-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.launcher-folder-inline-head button {
  min-height: 30px;
  padding: 0 10px;
  border-color: #54657a;
  background: #253248;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 900;
}

.launcher-folder-inline-head .launcher-folder-back {
  border-color: rgba(158, 231, 215, 0.42);
  background: #173331;
  color: #d8fff6;
}

.launcher-folder-inline-theater {
  overflow-x: auto;
  padding-bottom: 2px;
  scroll-snap-type: none;
}

.launcher-folder-inline-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(176px, 62vw);
  align-items: start;
  gap: 10px;
  padding: 2px max(12px, 19vw) 8px;
  scrollbar-width: none;
}

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

.launcher-folder-child-cover {
  contain-intrinsic-size: 210px 190px;
}

.launcher-folder-more {
  align-self: stretch;
  min-width: min(180px, 58vw);
  min-height: 96px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  background: rgba(15, 23, 42, 0.74);
  color: #f8fafc;
  font-size: 14px;
  font-weight: 900;
}

.launcher-folder-inline-empty {
  margin: 10px 12px;
  color: #b9c8d8;
  font-size: 13px;
}

.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: none;
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 260px 230px;
}

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

.launcher-cover.is-sending,
.launcher-card.is-sending,
.launcher-feature.is-sending {
  outline: 2px solid #2f7df6;
  outline-offset: -2px;
  transform: translateY(1px) scale(0.985);
  filter: brightness(1.12);
}

.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));
  }

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

@media (max-width: 760px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    height: auto;
    min-height: 60px;
    gap: 10px;
    padding: 8px 14px;
  }

  .topbar-brand {
    flex: 1 1 auto;
    gap: 7px;
  }

  .topbar-brand span {
    margin-left: 0;
  }

  .topbar-brand .pill {
    padding: 5px 10px;
  }

  .topbar-menu-button {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
  }

  .topbar nav {
    position: absolute;
    top: calc(100% + 6px);
    right: 12px;
    display: none;
    min-width: min(260px, calc(100vw - 24px));
    padding: 8px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
  }

  .topbar[data-menu-open="1"] nav {
    display: grid;
  }

  .topbar nav a,
  .topbar nav form,
  .topbar nav button {
    width: 100%;
  }

  .topbar nav a,
  .topbar nav button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 14px;
    text-align: left;
  }

  .topbar nav form button {
    background: #f1f5f9;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
    height: auto;
    gap: 12px;
  }

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

  .network-usage-kpis {
    grid-template-columns: 1fr;
  }

  .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-materials-link-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .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;
  }

  .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[data-view="paint"] {
    grid-template-rows: auto auto minmax(170px, 1fr) auto;
  }

  .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;
  }

  .remote-management-link {
    min-height: 26px;
    padding: 0 9px;
    font-size: 11px;
  }

  .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;
  }

  .remote footer .zoom-button {
    font-size: 15px;
  }

  .remote footer .zoom-reset-button {
    font-size: 13px;
  }

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

  .paint-panel {
    gap: 6px;
    padding: 8px 10px 10px;
  }

  .paint-toolbar {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
    gap: 6px;
  }

  .paint-segment,
  .paint-swatches,
  .paint-widths,
  .paint-text-row,
  .paint-zoom-actions,
  .paint-actions {
    gap: 5px;
  }

  .paint-panel button {
    min-height: 34px;
    font-size: 12px;
  }

  .paint-text-row input {
    min-height: 36px;
    font-size: 15px;
  }

  .paint-pad {
    min-height: 150px;
  }

  .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-folder-inline {
    margin: 6px 0 10px;
    padding-top: 8px;
  }

  .launcher-folder-inline-head {
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 0 8px 6px;
  }

  .launcher-folder-inline-head small {
    display: none;
  }

  .launcher-folder-inline-head button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 11px;
  }

  .launcher-folder-inline-strip {
    grid-auto-columns: minmax(154px, 48vw);
    gap: 8px;
    padding: 2px max(18px, 26vw) 8px;
  }

  .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;
  }
}
