:root {
  color-scheme: dark;
  --bg: #061c15;
  --felt: #0b3a2b;
  --felt-deep: #04140f;
  --panel: rgba(11, 26, 22, 0.9);
  --panel-2: rgba(16, 42, 34, 0.92);
  --border: rgba(174, 202, 179, 0.2);
  --text: #f2f7ee;
  --muted: #b5c7ba;
  --accent: #e64636;
  --accent-2: #e1bf68;
  --control: rgba(31, 68, 54, 0.92);
  --control-hover: rgba(43, 89, 70, 0.96);
  --shadow: rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --font-label: 12px;
  --font-body: 14px;
  --font-title: 16px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  position: relative;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.035), transparent 34%, rgba(0, 0, 0, 0.18) 72%),
    repeating-linear-gradient(8deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 17px),
    repeating-linear-gradient(96deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 23px),
    radial-gradient(ellipse at center, var(--felt) 0%, #082b20 52%, var(--felt-deep) 100%);
  color: var(--text);
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: 0;
  pointer-events: none;
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 58px, rgba(244, 232, 180, 0.035) 59px 61px, transparent 62px 120px),
    repeating-linear-gradient(132deg, transparent 0 44px, rgba(255, 255, 255, 0.025) 45px 47px, transparent 48px 92px);
  opacity: 0.55;
  transform: rotate(-2deg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(0, 0, 0, 0.08)),
    var(--control);
  color: var(--text);
  border-radius: var(--radius);
  min-height: 36px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.16);
}

button {
  cursor: pointer;
  padding: 0 12px;
}

button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.06)),
    var(--control-hover);
}

button.primary {
  background: linear-gradient(180deg, #ff5a49, #d63528);
  border-color: #ff7163;
  color: #fff;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 24px rgba(230, 70, 54, 0.28);
}

button.primary:hover {
  filter: brightness(1.06);
}

button.icon {
  width: 38px;
  padding: 0;
  font-weight: 800;
}

button.danger {
  color: #fff;
  background: linear-gradient(180deg, #b84537, #8f281f);
  border-color: rgba(255, 121, 104, 0.55);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns:
    minmax(280px, var(--main-column-width, 2fr)) 10px
    minmax(280px, var(--middle-column-width, 1fr)) 10px
    minmax(280px, var(--right-column-width, 1fr));
  gap: 2px;
  width: 100%;
  height: 100%;
  padding: 12px;
}

.main-panel,
.tools-panel {
  min-height: 0;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.1)),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 44px var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.main-panel {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto auto auto auto;
}

.tools-panel {
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.middle-panel,
.right-panel {
  min-width: 0;
}

.middle-panel {
  overflow: hidden;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(225, 191, 104, 0.09), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.12)),
    var(--panel-2);
}

.toolbar .title {
  flex: 0 0 auto;
  font-size: var(--font-title);
  font-weight: 800;
  white-space: nowrap;
  color: #fff8df;
  text-shadow: 0 1px 14px rgba(225, 191, 104, 0.18);
  margin-top: 0;
  margin-bottom: 0;
}

.app-title-group {
  display: flex;
  align-items: baseline;
  flex: 0 0 auto;
  gap: 6px;
  margin-right: auto;
  white-space: nowrap;
}

.global-text-loads {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-toolbar {
  min-width: 0;
}

.preset-more {
  position: relative;
}

.preset-more summary {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--control);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.preset-more summary::-webkit-details-marker {
  display: none;
}

.preset-more-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 6px;
  width: min(260px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0a261d;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.preset-more-panel button {
  width: 100%;
  text-align: left;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(3, 18, 13, 0.72);
}

.language-toggle button,
.toolbar .language-toggle button {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  font-size: 21px;
  line-height: 1;
  filter: grayscale(0.7);
  opacity: 0.58;
}

.language-toggle button:hover {
  background: rgba(43, 89, 70, 0.55);
  filter: grayscale(0.25);
  opacity: 0.86;
}

.language-toggle button.is-active {
  background: var(--control-hover);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 12px rgba(0, 0, 0, 0.2);
  filter: none;
  opacity: 1;
}

.flag-icon {
  position: relative;
  display: block;
  width: 27px;
  height: 18px;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.26), 0 2px 5px rgba(0, 0, 0, 0.3);
}

.flag-br {
  background: #229e45;
}

.flag-br::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 7px;
  width: 13px;
  height: 13px;
  background: #f8d348;
  transform: rotate(45deg);
}

.flag-br::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #244aa5;
}

.flag-uk {
  background:
    linear-gradient(34deg, transparent 42%, #fff 42% 48%, #c8102e 48% 52%, #fff 52% 58%, transparent 58%),
    linear-gradient(-34deg, transparent 42%, #fff 42% 48%, #c8102e 48% 52%, #fff 52% 58%, transparent 58%),
    #012169;
}

.flag-uk::before,
.flag-uk::after {
  content: "";
  position: absolute;
  background: #c8102e;
  box-shadow: 0 0 0 2px #fff;
}

.flag-uk::before {
  top: 7px;
  left: 0;
  width: 100%;
  height: 4px;
}

.flag-uk::after {
  top: 0;
  left: 12px;
  width: 4px;
  height: 100%;
}

.toolbar select {
  min-width: 118px;
  padding: 0 8px;
}

.toolbar button {
  min-width: 60px;
  padding: 0 8px;
}

.editor-wrap {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  min-height: 0;
}

.indicator {
  position: relative;
  background:
    linear-gradient(180deg, rgba(225, 191, 104, 0.72), rgba(108, 76, 24, 0.74)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent 50%, rgba(0, 0, 0, 0.24));
  cursor: ns-resize;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.28);
}

.indicator::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  top: var(--indicator-y, 0%);
  background: var(--accent);
  transform: translateY(-50%);
}

textarea.script-editor {
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  outline: 2px solid transparent;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 24%),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(255, 255, 255, 0.018) 39px 40px),
    rgba(2, 16, 12, 0.74);
  color: var(--text);
  line-height: 1.45;
  font-size: 16px;
  box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.18);
}

textarea.script-editor:focus-visible {
  outline-color: var(--accent-2);
  outline-offset: -3px;
}

.editor-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  padding: 5px 10px;
  border-top: 1px solid rgba(174, 202, 179, 0.1);
  background: rgba(3, 18, 13, 0.78);
  color: var(--muted);
  font-size: 12px;
}

.local-save-status {
  color: #8cdbad;
  white-space: nowrap;
}

#appStatus {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transport {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(230, 70, 54, 0.1), transparent 45%, rgba(225, 191, 104, 0.08)),
    var(--panel-2);
}

.main-footer {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(250px, auto);
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(225, 191, 104, 0.08), transparent 42%),
    rgba(6, 24, 18, 0.88);
}

.promo-banner {
  container-type: inline-size;
  min-width: 0;
  min-height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(242, 247, 238, 0.16);
  border-radius: var(--radius);
  background: rgba(3, 18, 13, 0.68);
}

.promo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 4px 10px;
  overflow: hidden;
  color: #f6f1e8;
  background-color: var(--promo-tone);
  font-size: 12px;
  text-decoration: none;
  transition:
    background-color 650ms ease,
    filter 160ms ease;
}

.promo-link:hover {
  filter: brightness(1.1);
}

.promo-link:focus-visible {
  outline: 2px solid var(--promo-accent);
  outline-offset: -3px;
}

.promo-kicker {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--promo-accent), transparent 30%);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
  color: var(--promo-accent);
  white-space: nowrap;
  transition:
    border-color 650ms ease,
    color 650ms ease;
}

.promo-message {
  min-width: 0;
  overflow: hidden;
  color: #f6f1e8;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promo-link.is-changing .promo-kicker,
.promo-link.is-changing .promo-message {
  animation: promo-reveal 420ms ease both;
}

@container (max-width: 400px) {
  .promo-link {
    flex-direction: column;
    gap: 2px;
    padding-block: 3px;
  }

  .promo-kicker {
    padding-block: 1px;
    font-size: 9px;
  }

  .promo-message {
    max-width: 100%;
  }
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 0;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.2;
}

.footer-links a:hover {
  color: var(--accent-2);
  text-decoration: underline;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
}

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

.info-dialog {
  position: relative;
  width: min(620px, 100%);
  max-height: min(640px, calc(100vh - 36px));
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(140deg, rgba(225, 191, 104, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(21, 56, 43, 0.96), rgba(5, 21, 15, 0.98));
  color: var(--text);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

.info-dialog h2 {
  margin: 0 44px 12px 0;
  font-size: 22px;
}

.info-dialog p {
  margin: 0 0 12px;
  color: color-mix(in srgb, var(--text), var(--muted) 22%);
  line-height: 1.5;
}

.info-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  min-height: 34px;
  padding: 0;
}

.stack {
  flex: 0 0 auto;
  min-height: auto;
  padding: 8px 10px;
  overflow: visible;
}

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

.middle-panel .control-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.control {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.middle-panel .control {
  grid-template-columns: 96px minmax(0, 1fr) 48px;
  gap: 7px;
}

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

.control-help {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-left: 4px;
  border: 1px solid rgba(225, 191, 104, 0.5);
  border-radius: 50%;
  color: var(--accent-2);
  font-size: 10px;
  cursor: help;
}

.control output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: var(--font-label);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.checks,
.window-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  color: var(--text);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.08)),
    rgba(20, 54, 42, 0.86);
  border-radius: var(--radius);
  padding: 0 8px;
}

.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.mirror-settings .checks {
  gap: 4px;
  margin-top: 4px;
}

.mirror-settings .check {
  min-height: 28px;
  gap: 4px;
  padding: 0 6px;
  font-size: 10px;
  line-height: 1.15;
}

.mirror-settings .check input {
  width: 14px;
  height: 14px;
}

.section-title {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: var(--font-label);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  flex: 0 0 var(--preview-height, 360px);
  min-height: 260px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.preview-shell > .preview-toolbar {
  grid-row: 1;
}

.preview-shell > .remote-launch-row {
  grid-row: 2;
}

.preview-shell > .remote-inline-status {
  grid-row: 3;
}

.preview-shell > .window-status {
  grid-row: 4;
}

.preview-shell > .canvas-wrap {
  grid-row: 5;
}

.preview-toolbar,
.bindings-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background:
    linear-gradient(90deg, rgba(225, 191, 104, 0.08), transparent 44%),
    var(--panel-2);
  border-bottom: 1px solid var(--border);
}

.preview-toolbar span,
.bindings-toolbar span {
  margin-right: auto;
  font-size: var(--font-body);
  font-weight: 700;
}

.preview-source-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(225, 191, 104, 0.3);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.preview-source-toggle button {
  min-height: 28px;
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: rgba(255, 248, 223, 0.72);
  font-size: 11px;
}

.preview-source-toggle button.is-active {
  background: rgba(225, 191, 104, 0.2);
  color: #fff8df;
}

.preview-source-toggle button:disabled {
  opacity: 0.38;
}

.window-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid rgba(174, 202, 179, 0.12);
  background:
    linear-gradient(90deg, rgba(225, 191, 104, 0.12), transparent 45%),
    rgba(3, 18, 13, 0.66);
}

.window-status strong {
  margin-right: 4px;
  color: #fff8df;
  font-size: 13px;
}

.window-status span {
  border: 1px solid rgba(225, 191, 104, 0.34);
  border-radius: 999px;
  padding: 4px 9px;
  color: #fff8df;
  font-size: 12px;
  font-weight: 700;
}

.window-status .is-ok {
  border-color: rgba(82, 211, 143, 0.48);
  background: rgba(82, 211, 143, 0.14);
}

.window-status .is-warning {
  border-color: rgba(239, 83, 71, 0.62);
  background: rgba(239, 83, 71, 0.18);
}

.window-status .is-muted {
  border-color: rgba(174, 202, 179, 0.2);
  background: rgba(174, 202, 179, 0.08);
  color: rgba(255, 248, 223, 0.78);
}

.canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(225, 191, 104, 0.05), transparent 18%),
    #050706;
  box-shadow: inset 0 0 0 1px rgba(225, 191, 104, 0.08);
}

.inline-preview-frame {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  background: #000;
  box-shadow:
    0 0 0 1px rgba(225, 191, 104, 0.18),
    0 14px 34px rgba(0, 0, 0, 0.3);
}

.column-resizer,
.preview-resizer {
  position: relative;
  z-index: 4;
  touch-action: none;
  user-select: none;
}

.column-resizer {
  cursor: col-resize;
}

.preview-resizer {
  flex: 0 0 10px;
  cursor: row-resize;
  border-top: 1px solid rgba(225, 191, 104, 0.16);
  border-bottom: 1px solid rgba(225, 191, 104, 0.16);
  background: rgba(225, 191, 104, 0.06);
}

.column-resizer::after,
.preview-resizer::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(225, 191, 104, 0.52);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.column-resizer::after {
  top: 50%;
  left: 4px;
  width: 2px;
  height: 54px;
  transform: translateY(-50%);
}

.preview-resizer::after {
  top: 4px;
  left: 50%;
  width: 54px;
  height: 2px;
  transform: translateX(-50%);
}

.column-resizer:hover::after,
.column-resizer:focus-visible::after,
.preview-resizer:hover::after,
.preview-resizer:focus-visible::after {
  background: var(--accent-2);
  box-shadow: 0 0 12px rgba(225, 191, 104, 0.55);
}

.is-resizing-columns,
.is-resizing-preview {
  cursor: col-resize;
  user-select: none;
}

.is-resizing-preview {
  cursor: row-resize;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

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

.cloud-library {
  border-bottom: 1px solid rgba(174, 202, 179, 0.12);
}

.cloud-library .bindings-toolbar {
  margin: -10px -10px 10px;
}

.cloud-toolbar {
  align-items: flex-start;
}

.cloud-toolbar-identity {
  display: grid;
  flex: 1 1 160px;
  gap: 3px;
  min-width: 0;
}

.cloud-toolbar .cloud-toolbar-title {
  margin-right: 0;
  color: var(--text);
  font-size: var(--font-body);
  font-weight: 700;
}

.cloud-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.cloud-grid {
  display: grid;
  gap: 8px;
}

.cloud-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  max-height: min(28vh, 250px);
  overflow: auto;
  padding-right: 2px;
}

.cloud-script-item {
  display: block;
  overflow: hidden;
  width: 100%;
  min-height: 62px;
  padding: 0;
  border: 1px solid rgba(174, 202, 179, 0.3);
  border-radius: 10px;
  background: rgba(8, 28, 22, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease;
}

.cloud-script-item:hover {
  border-color: rgba(225, 191, 104, 0.52);
  background: rgba(12, 42, 32, 0.98);
}

.cloud-script-body {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 8px;
}

.cloud-script-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 10px;
  background: linear-gradient(145deg, var(--cloud-script-pastel), var(--cloud-script-pastel-deep));
  color: var(--cloud-script-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 7px 14px rgba(0, 0, 0, 0.2);
}

.cloud-script-icon::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-bottom-left-radius: 5px;
  background: rgba(255, 255, 255, 0.56);
}

.cloud-script-icon strong {
  max-width: 42px;
  overflow: hidden;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
}

.cloud-script-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cloud-script-title {
  overflow: hidden;
  width: 100%;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-script-opened {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-script-item.is-active {
  border-color: rgba(225, 191, 104, 0.72);
  background: rgba(31, 68, 54, 0.96);
  box-shadow:
    inset 0 0 0 1px rgba(225, 191, 104, 0.22),
    0 4px 10px rgba(0, 0, 0, 0.2);
}

.cloud-empty {
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px dashed rgba(174, 202, 179, 0.24);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.cloud-user {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.cloud-user strong {
  color: #fff8df;
  font-weight: 700;
}

.cloud-field {
  display: grid;
  gap: 5px;
}

.cloud-field span {
  color: var(--muted);
  font-size: 12px;
}

.cloud-field input,
.cloud-field select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(3, 18, 13, 0.8);
  color: var(--text);
  padding: 0 8px;
}

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

.cloud-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 0.7fr);
  gap: 8px;
}

.cloud-signed-out {
  display: grid;
  gap: 8px;
  padding: 4px 0 2px;
}

.cloud-signed-out p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.cloud-actions button {
  min-width: 0;
  padding: 0 8px;
}

.cloud-status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

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

.rehearsal-panel {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: rgba(3, 18, 13, 0.42);
}

.rehearsal-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.rehearsal-heading .section-title {
  margin: 0;
}

.rehearsal-heading > span {
  color: var(--muted);
  font-size: var(--font-label);
  line-height: 1.3;
}

.rehearsal-heading strong {
  color: var(--text);
  font-weight: 600;
}

.rehearsal-grid > div,
.number-control {
  display: grid;
  gap: 3px;
  min-height: 44px;
  padding: 7px;
  border: 1px solid rgba(174, 202, 179, 0.12);
  border-radius: var(--radius);
  background: rgba(3, 18, 13, 0.36);
}

.rehearsal-grid span,
.number-control span {
  color: var(--muted);
  font-size: var(--font-label);
}

.rehearsal-grid strong {
  color: #fff8df;
  font-variant-numeric: tabular-nums;
}

.number-control {
  grid-template-columns: minmax(0, 1fr) 68px 18px;
  align-items: center;
}

.number-control input {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(3, 18, 13, 0.8);
  color: var(--text);
  padding: 0 6px;
}

.number-control em {
  color: var(--muted);
  font-style: normal;
  font-size: var(--font-label);
}

.binding-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(74px, 0.85fr) 70px;
  gap: 6px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(174, 202, 179, 0.08);
}

.binding-row button {
  min-width: 0;
  padding: 0 8px;
}

.binding-row .binding-name {
  color: var(--text);
}

.binding-row .binding-value {
  color: #e4c777;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  min-height: 22px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.display-page {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}

.display-root,
.display-root body,
.display-root #app {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

.display-page > canvas {
  position: absolute;
  inset: 0;
}

.display-page canvas {
  cursor: none;
}

.display-page.preview-mode canvas {
  cursor: default;
}

.display-page.remote-display-mode canvas {
  cursor: grab;
  touch-action: none;
}

.display-page.remote-display-mode canvas:active {
  cursor: grabbing;
}

.display-topbar {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(225, 191, 104, 0.28);
  border-radius: var(--radius);
  background: rgba(5, 24, 18, 0.84);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
}

.display-ui {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.display-ui.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.display-topbar span {
  color: #fff8df;
  font-size: 13px;
  font-weight: 700;
}

.display-topbar .preview-source-toggle {
  margin-left: 2px;
}

.preview-transport {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, auto));
  gap: 8px;
  width: min(760px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid rgba(225, 191, 104, 0.28);
  border-radius: var(--radius);
  background: rgba(5, 24, 18, 0.88);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.34);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.preview-transport button {
  min-width: 0;
}

.remote-display-mode .display-topbar {
  top: auto;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.remote-display-mode .display-topbar > span {
  display: none;
}

.remote-display-mode #fullscreenBtn {
  min-height: 44px;
  border-color: rgba(225, 191, 104, 0.42);
  background: rgba(5, 24, 18, 0.88);
  backdrop-filter: blur(10px);
}

.remote-display-mode .floating-status {
  display: none;
}

.floating-status {
  position: fixed;
  left: 12px;
  bottom: 12px;
  max-width: min(520px, calc(100vw - 24px));
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(5, 24, 18, 0.76);
  border: 1px solid rgba(225, 191, 104, 0.22);
  color: #fff;
  font-size: 12px;
  pointer-events: none;
}

.presenter-timer {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 2;
  display: grid;
  min-width: 148px;
  padding: 10px 12px;
  border: 1px solid rgba(225, 191, 104, 0.34);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  pointer-events: none;
}

.presenter-timer[hidden] {
  display: none;
}

.presenter-timer span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.presenter-timer strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.presenter-countdown {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  pointer-events: none;
}

.presenter-countdown[hidden] {
  display: none;
}

.presenter-countdown span {
  font-size: clamp(18px, 2.4vw, 36px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.presenter-countdown strong {
  font-size: clamp(96px, 24vw, 320px);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.72);
}

.inline-preview-timer {
  position: absolute;
  top: 16px;
  left: 16px;
  min-width: 112px;
  padding: 7px 9px;
  transform-origin: top left;
}

.inline-preview-timer span {
  font-size: 9px;
}

.inline-preview-timer strong {
  font-size: 17px;
}

.inline-preview-countdown {
  position: absolute;
}

.inline-preview-countdown span {
  font-size: 10px;
}

.inline-preview-countdown strong {
  font-size: clamp(52px, 8vw, 96px);
}

.window-blocked-help {
  flex-basis: 100%;
  border: 0 !important;
  padding: 0 !important;
  color: var(--muted) !important;
  font-weight: 400 !important;
  line-height: 1.35;
}

.window-fallback {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

.preset-dialog {
  width: min(520px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0a261d;
  color: var(--text);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.62);
}

.preset-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
}

.dialog-content {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.dialog-content h2,
.dialog-content p {
  margin: 0;
}

.dialog-content p,
.dialog-help {
  color: var(--muted);
  line-height: 1.5;
}

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

.dialog-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(3, 18, 13, 0.9);
  color: var(--text);
  padding: 0 10px;
}

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible,
[role="slider"]:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 2px;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(8deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 18px),
    radial-gradient(ellipse at center, #0b3a2b 0%, #04140f 72%);
  color: #fff8df;
  transition: opacity 260ms ease;
}

.splash.hide {
  opacity: 0;
  pointer-events: none;
}

.splash-box {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.site-page {
  min-height: 100%;
  height: auto;
  overflow: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 10px max(18px, calc((100% - 1100px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(5, 24, 18, 0.94);
  backdrop-filter: blur(14px);
}

.site-brand {
  margin-right: auto;
  color: #fff8df;
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-nav a,
.site-footer a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--accent-2);
}

.site-language-toggle {
  flex: 0 0 auto;
}

.site-app-link {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(225, 191, 104, 0.5);
  border-radius: var(--radius);
  background: rgba(225, 191, 104, 0.1);
  color: #fff8df;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-content {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 52px;
}

.site-content h1 {
  margin: 18px 0;
  color: #fff8df;
  font-size: clamp(32px, 6vw, 58px);
  letter-spacing: 0;
}

.site-content p {
  color: color-mix(in srgb, var(--text), var(--muted) 16%);
  font-size: 18px;
  line-height: 1.65;
}

.site-kicker {
  margin: 0 !important;
  color: var(--accent-2) !important;
  font-size: 13px !important;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-lead {
  max-width: 760px;
  margin-bottom: 48px !important;
  color: #e1ebe4 !important;
  font-size: clamp(19px, 2.8vw, 24px) !important;
}

.site-sections {
  display: grid;
  gap: 16px;
}

.site-sections section {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 35, 26, 0.72);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

.site-sections h2 {
  margin: 0 0 8px;
  color: #fff8df;
  font-size: 21px;
}

.site-sections p {
  margin: 0;
  font-size: 16px;
}

.site-contact {
  display: inline-flex;
  margin-top: 14px;
  color: var(--accent-2);
  font-weight: 800;
}

.site-updated {
  margin-top: 28px !important;
  color: var(--muted) !important;
  font-size: 13px !important;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.site-back {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 700;
}

.site-back:hover {
  text-decoration: underline;
}

.pulse {
  width: 86px;
  height: 86px;
  border: 3px solid var(--accent);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  animation: pulse 900ms ease-in-out infinite;
  box-shadow: 0 0 32px rgba(230, 70, 54, 0.24);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@keyframes promo-reveal {
  from {
    opacity: 0.35;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  html,
  body,
  #app {
    height: auto;
    min-height: 100%;
  }

  .app-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    height: auto;
    min-height: 100vh;
  }

  .main-panel {
    grid-column: 1 / -1;
    min-height: 700px;
  }

  .column-resizer {
    display: none;
  }

  .tools-panel {
    min-height: 620px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .tools-panel {
    min-height: auto;
  }

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

  .preview-shell {
    flex-basis: var(--preview-height, 360px);
  }

  .site-header {
    flex-wrap: wrap;
  }

  .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

@media (max-width: 620px) {
  .preview-transport {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .app-title-group {
    width: 100%;
  }

  .preset-toolbar {
    width: 100%;
  }

  .preset-toolbar select {
    flex: 1 1 120px;
  }

  .language-toggle {
    margin-left: auto;
  }

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

  .main-footer {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: center;
  }

  .control {
    grid-template-columns: 92px minmax(0, 1fr) 48px;
  }

  .binding-row {
    grid-template-columns: 1fr;
  }

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

  .cloud-filters {
    grid-template-columns: 1fr;
  }

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

  .rehearsal-panel {
    grid-template-columns: 1fr;
  }

  button,
  select {
    min-height: 42px;
  }

  .editor-status-row {
    align-items: flex-start;
    flex-direction: column;
  }

  #appStatus {
    text-align: left;
  }

  .site-header {
    gap: 10px;
    padding: 10px 16px;
  }

  .site-brand {
    width: 100%;
  }

  .site-app-link {
    flex: 1;
  }

  .site-nav {
    gap: 18px;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .site-content {
    padding-top: 44px;
  }

  .site-sections section {
    padding: 18px;
  }
}

.remote-launch-row,
.remote-session-heading,
.remote-session-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.remote-launch-row {
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid rgba(201, 169, 91, 0.24);
  border-radius: 12px;
  background: rgba(201, 169, 91, 0.07);
}

.remote-launch-row div,
.remote-session-heading div,
.remote-code-block {
  display: grid;
  gap: 3px;
}

.remote-launch-row span,
.remote-session-heading span,
.remote-code-block span,
.remote-code-block p,
.remote-privacy {
  color: var(--muted);
  font-size: 0.78rem;
}

.remote-launch-actions {
  display: flex !important;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px !important;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  white-space: nowrap;
}

.button-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.remote-session-card {
  width: min(92vw, 760px);
  padding: 24px;
  border: 1px solid rgba(88, 195, 151, 0.34);
  border-radius: 22px;
  background: #0a2d22;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.6);
}

.remote-session-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(1, 10, 7, 0.82);
  backdrop-filter: blur(12px);
}

.remote-session-backdrop[hidden] {
  display: none;
}

.remote-session-heading {
  justify-content: space-between;
  margin-bottom: 20px;
}

.remote-session-heading strong {
  font-size: 1.4rem;
}

#closeRemoteSessionModal {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.5rem;
}

.remote-session-content canvas {
  width: 320px;
  height: 320px;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
}

.remote-code-block {
  flex: 1;
}

.remote-code-block strong {
  color: var(--accent);
  font-size: 1.8rem;
  letter-spacing: 0.12em;
}

.remote-code-block p {
  margin: 8px 0 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.remote-inline-status:empty { display: none; }

.remote-join-body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #164e3b 0, #071711 58%, #030a07 100%);
}

.remote-loading-root,
.remote-loading-root body,
.remote-loading-root #app {
  width: 100%;
  min-height: 100%;
}

.remote-loading-body {
  min-height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at top, #164e3b 0, #071711 58%, #030a07 100%);
}

.remote-loading-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.remote-loading-card {
  width: min(100%, 430px);
  padding: 32px;
  border: 1px solid rgba(201, 169, 91, 0.32);
  border-radius: 24px;
  background: rgba(8, 31, 23, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.remote-loading-card > strong {
  display: block;
  color: #fff8df;
  font-size: 1.45rem;
}

.remote-loading-track {
  height: 12px;
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid rgba(201, 169, 91, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

#remoteLoadingBar {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, #58c397, #e1bf68);
  box-shadow: 0 0 22px rgba(88, 195, 151, 0.34);
  transition: width 90ms linear;
}

#remoteLoadingBar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 15%, rgba(255, 255, 255, 0.5) 48%, transparent 78%);
  transform: translateX(-100%);
  animation: remote-loading-shimmer 900ms linear infinite;
}

.remote-loading-percent {
  margin-top: 10px;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.remote-loading-message,
.remote-loading-slow {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.remote-loading-slow {
  padding: 12px 14px;
  border: 1px solid rgba(225, 191, 104, 0.28);
  border-radius: 12px;
  color: #fff1bd;
  background: rgba(225, 191, 104, 0.08);
}

.remote-loading-slow[hidden] {
  display: none;
}

@keyframes remote-loading-shimmer {
  to { transform: translateX(100%); }
}

.remote-join-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
}

.remote-join-card {
  width: min(100%, 430px);
  padding: 30px;
  border: 1px solid rgba(201, 169, 91, 0.32);
  border-radius: 24px;
  background: rgba(8, 31, 23, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.remote-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 16px;
  color: #10261e;
  background: var(--accent);
  font-weight: 900;
}

.remote-join-card h1 { margin: 0 0 10px; font-size: 1.65rem; }
.remote-join-card > p { color: var(--muted); line-height: 1.55; }
.remote-join-card form { display: grid; gap: 10px; margin-top: 24px; }
.remote-join-card input {
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  font-size: 1.35rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.remote-join-card form button { min-height: 48px; }
.remote-join-status { min-height: 22px; margin-top: 15px; color: var(--accent); }
.remote-privacy { margin: 18px 0 0 !important; }

.remote-display-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(3, 14, 10, 0.86);
  backdrop-filter: blur(10px);
}

.remote-display-controls button { min-height: 42px; }
.remote-gesture-hint {
  grid-column: 1 / -1;
  padding: 2px 4px 0;
  color: rgba(255, 248, 223, 0.68);
  font-size: 0.72rem;
  text-align: center;
}

.remote-connection-badge {
  justify-self: center;
  margin-top: 7px;
  color: #8fe0bd;
  font-size: 0.75rem;
}

.remote-zoom-badge {
  position: fixed;
  z-index: 6;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  min-width: 126px;
  padding: 10px 14px;
  border: 1px solid rgba(225, 191, 104, 0.42);
  border-radius: 999px;
  color: #fff8df;
  background: rgba(3, 14, 10, 0.9);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.36);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.remote-zoom-badge[hidden] { display: none; }

@media (max-width: 620px) {
  .remote-session-card { padding: 18px; }
  .remote-session-content { flex-direction: column; align-items: center; }
  .remote-session-content canvas { width: min(72vw, 280px); height: min(72vw, 280px); }
  .remote-code-block { width: 100%; text-align: center; }
  .remote-launch-row { align-items: flex-start; }
  .remote-launch-actions { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
