html,
body,
#app {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1e1f22;
  color: #d7dae0;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#app {
  position: fixed;
  inset: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#editor-canvas {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  outline: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.input-bridge {
  position: fixed;
  left: 0;
  top: 0;
  width: 2px;
  height: 24px;
  opacity: 0.01;
  z-index: 1;
  font-size: 16px;
  line-height: 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transform: translate3d(0, 0, 0);
  resize: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: transparent;
  background: transparent;
  caret-color: transparent;
  outline: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.system-clipboard-overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--system-clipboard-width, 100vw);
  height: var(--system-clipboard-height, 100dvh);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: var(--system-clipboard-overlay-bg, rgb(0 0 0 / 48%));
  box-sizing: border-box;
  overflow: auto;
  touch-action: manipulation;
  -webkit-overflow-scrolling: touch;
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

.system-clipboard-dialog {
  width: min(420px, 100%);
  max-height: calc(var(--system-clipboard-height, 100dvh) - 24px);
  box-sizing: border-box;
  border: 1px solid var(--system-clipboard-divider, #3a3f4b);
  background: var(--system-clipboard-panel, rgb(37 40 46 / 99%));
  color: var(--system-clipboard-text, #d7dae0);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  margin-top: clamp(8px, 6vh, 44px);
  padding: 16px 18px 18px;
  box-shadow: 0 18px 48px rgb(0 0 0 / 38%);
  overflow: hidden;
}

.system-clipboard-dialog h2 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.25;
}

.system-clipboard-dialog p {
  margin: 0 0 14px;
  color: var(--system-clipboard-text-dim, #a7adba);
  font-size: 13px;
  line-height: 1.45;
}

.system-clipboard-field {
  width: 100%;
  min-height: 76px;
  box-sizing: border-box;
  border: 1px solid var(--system-clipboard-divider, #3a3f4b);
  background: var(--system-clipboard-field-bg, #1e1f22);
  color: var(--system-clipboard-text, #d7dae0);
  outline: none;
  resize: none;
  padding: 8px 9px;
  font: 16px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  flex: 1 1 104px;
  max-height: 220px;
  touch-action: manipulation;
  user-select: text;
  -webkit-user-select: text;
}

.system-clipboard-field:focus {
  border-color: var(--system-clipboard-accent, #4f8cff);
}

.system-clipboard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.system-clipboard-button {
  min-width: 82px;
  height: 30px;
  border: 0;
  border-radius: 0;
  color: var(--system-clipboard-button-text, #d7dae0);
  font: 13px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 0 12px;
}

.system-clipboard-button.primary {
  background: var(--system-clipboard-accent, #4f8cff);
}

.system-clipboard-button.secondary {
  background: var(--system-clipboard-secondary, #363a43);
}

.system-clipboard-button:disabled {
  opacity: 0.48;
}

.system-file-upload-field {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--system-clipboard-divider, #3a3f4b);
  background: var(--system-clipboard-field-bg, #1e1f22);
  color: var(--system-clipboard-text, #d7dae0);
  outline: none;
  padding: 9px;
  font: 16px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: manipulation;
  user-select: text;
  -webkit-user-select: text;
  -webkit-touch-callout: default;
}

.system-file-upload-status {
  min-height: 18px;
  margin-top: 10px;
}
