* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

:root {
  --bg-primary: #081121;
  --bg-gradient-base: #0063e6;
  --bg-gradient-start: #0a2242;
  --bg-gradient-mid: #134484;
  --bg-gradient-end: #3d70b3;
  --bg-secondary: #0d1b2f;
  --bg-panel: #0a1729;
  --bg-elevated: #142742;
  --bg-contrast: #040b16;
  --border-color: #24415f;
  --control-bg: #122640;
  --input-border: #2d4f73;
  --hover-bg: #173457;
  --text-primary: #ecf4ff;
  --text-secondary: #c6d8f3;
  --text-muted: #8eaacc;
  --accent-color: #2d8cff;
  --accent-color-strong: #1f6ecf;
  --accent-color-soft: #59a7ff;
  --accent-color-deep: #164a94;
  --accent-color-contrast: #ffffff;
  --accent-color-rgb: 45, 140, 255;
  --accent-color-soft-rgb: 89, 167, 255;
  --scrollbar-thumb: #2a4c6f;
  --scrollbar-thumb-hover: #376086;
  --editor-minimap-width: 102px
}

body.light-theme {
  --bg-primary: #edf3fb;
  --bg-secondary: #f7f9fd;
  --bg-panel: #ebf1fa;
  --bg-elevated: #e3ebf7;
  --bg-contrast: #dbe4f2;
  --border-color: #cfd9e8;
  --control-bg: #f8fbff;
  --input-border: #bcc8dc;
  --hover-bg: #dfe8f5;
  --text-primary: #0f1c33;
  --text-secondary: #1b2a41;
  --text-muted: #5b6b82;
  --scrollbar-thumb: #bdc9de;
  --scrollbar-thumb-hover: #a8b7d1
}

body {
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(130deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
  color: var(--text-secondary);
  overflow: hidden;
  font-size: 13px;
  color-scheme: dark
}

body.light-theme {
  color-scheme: light
}

.remix-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: transparent
}

.remix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  height: 50px;
  z-index: 100;
  flex-shrink: 0
}

.header-left {
  display: flex;
  align-items: center
}

.remix-logo {
  display: flex;
  align-items: center;
  gap: 8px
}

.logo-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-left: 4px;
  max-width: 620px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.logo-beta {
  font-style: italic;
  font-weight: 500;
  color: #fff;
  opacity: 1;
  margin-left: 4px
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center
}

.current-file-name {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500
}

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

.network-indicator {
  display: flex;
  align-items: center;
  gap: 8px
}

.network-badge,
.proxy-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg-elevated);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1
}

.network-text,
.proxy-status-text {
  display: inline-flex;
  align-items: center;
  color: var(--text-primary);
  line-height: 1
}

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

.network-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc3545
}

.network-dot.connected {
  background: #28a745
}

.proxy-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc3545
}

.proxy-dot.connected {
  background: #28a745
}

.remix-main {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow: hidden
}

.remix-icon-panel {
  width: 132px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 8px 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 40
}

.icon-group {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.icon-item {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s;
  color: var(--text-secondary);
  position: relative;
  border-left: 3px solid transparent
}

.icon-item:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  transform: translate(1px)
}

.icon-item.active {
  background: var(--hover-bg);
  border-left-color: var(--accent-color);
  color: var(--text-primary)
}

.icon-separator {
  height: 1px;
  background: var(--border-color);
  margin: 8px 4px
}

.icon-symbol {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: inherit
}

.icon-symbol svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round
}

.icon-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em
}

.icon-check {
  position: absolute;
  right: 6px;
  bottom: 5px;
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  background: #22c55e;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .2);
  display: inline-flex;
  flex: 0 0 12px;
  align-items: center;
  justify-content: center;
  margin: 0;
  box-sizing: border-box;
  line-height: 0;
  z-index: 2
}

.icon-check:before {
  content: "";
  width: 4px;
  height: 6px;
  border-right: 1.8px solid #ffffff;
  border-bottom: 1.8px solid #ffffff;
  transform: translateY(-1px) rotate(45deg)
}

.github-corner {
  position: fixed;
  left: 12px;
  bottom: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 8px 18px #00000059;
  text-decoration: none;
  z-index: 120
}

.github-corner svg {
  width: 20px;
  height: 20px;
  fill: currentColor
}

.github-corner:hover {
  background: #1f2937
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden
}

.remix-sidebar {
  width: 320px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  min-width: 280px
}

.vertical-resizer {
  width: 4px;
  background: var(--border-color);
  cursor: col-resize;
  flex-shrink: 0;
  transition: background-color .2s
}

.vertical-resizer:hover {
  background: var(--accent-color)
}

.right-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0
}

.remix-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
  min-width: 0
}

.horizontal-resizer {
  height: 6px;
  background: var(--border-color);
  cursor: row-resize;
  flex-shrink: 0;
  transition: background-color .2s
}

.horizontal-resizer:hover {
  background: var(--accent-color)
}

.remix-terminal {
  height: 260px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0
}

.plugin-content {
  display: none;
  flex: 1;
  overflow: hidden;
  flex-direction: column;
  min-height: 0
}

.plugin-content.active {
  display: flex
}

.plugin-content[data-content=udapp] {
  overflow: visible
}

.plugin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0
}

.plugin-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0
}

.plugin-actions {
  display: flex;
  gap: 4px
}

.action-btn {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Segoe UI Symbol, Segoe UI, sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1
}

.action-btn:hover {
  background: var(--border-color);
  color: var(--text-primary)
}

#create-file-btn {
  font-size: 18px
}

.workspace-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden
}

.workspace-selector {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0
}

.workspace-dropdown {
  width: 100%;
  background: var(--control-bg);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  color: var(--text-secondary);
  padding: 6px 8px;
  font-size: 12px
}

.workspace-actions {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0
}

.workspace-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #1f6ecf;
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background-color .2s
}

.workspace-action-btn:hover {
  background: #2d8cff
}

.workspace-action-btn svg {
  width: 16px;
  height: 16px
}

.file-explorer {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0
}

.folder-item {
  margin-bottom: 4px
}

.folder-header {
  display: flex;
  align-items: center;
  margin: 2px 8px;
  padding: 6px 10px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: background-color .2s, border-color .2s;
  font-size: 13px
}

.folder-header:hover {
  background: var(--hover-bg);
  background: color-mix(in srgb, var(--bg-gradient-mid) 62%, var(--bg-secondary) 38%);
  border-color: #fff9
}

.folder-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e2b668;
  margin-right: 6px;
  flex-shrink: 0
}

.folder-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor
}

.folder-name {
  flex: 1;
  color: var(--text-secondary)
}

.entry-delete-btn {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 4px;
  margin-left: 8px;
  background: #ffffff14;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: background-color .2s, color .2s, opacity .2s
}

.folder-header:hover .entry-delete-btn,
.file-item:hover .entry-delete-btn {
  opacity: 1;
  pointer-events: auto
}

.entry-delete-btn:hover {
  background: #ffb34740;
  color: #ffd18f
}

.folder-actions {
  display: none;
  gap: 2px
}

.folder-header:hover .folder-actions {
  display: flex
}

.folder-action-btn {
  width: 16px;
  height: 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center
}

.folder-action-btn:hover {
  background: var(--border-color)
}

.folder-content {
  padding-left: 20px
}

.file-item {
  display: flex;
  align-items: center;
  margin: 2px 8px;
  padding: 6px 10px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 4px;
  transition: background-color .2s, border-color .2s;
  font-size: 13px;
  position: relative
}

.file-item:hover {
  background: var(--hover-bg);
  background: color-mix(in srgb, var(--bg-gradient-mid) 62%, var(--bg-secondary) 38%);
  border-color: #fff9
}

.file-item.active {
  background: var(--hover-bg);
  background: color-mix(in srgb, var(--bg-gradient-end) 56%, var(--bg-secondary) 44%);
  border-color: #ffffffa6;
  color: var(--text-primary)
}

.file-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  flex-shrink: 0
}

.file-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block
}

.file-name {
  color: var(--text-secondary);
  flex: 1
}

.file-trailing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto
}

.file-item.active .file-name {
  color: var(--text-primary)
}

.file-modified,
.tab-modified {
  color: #f6851b !important;
  font-weight: 700;
  margin-left: 0
}

.context-menu {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px 0;
  min-width: 150px;
  box-shadow: 0 4px 8px #0000004d;
  z-index: 1000;
  font-size: 12px
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background-color .2s
}

.context-menu-item:hover {
  background: var(--hover-bg)
}

.context-menu-item.danger {
  color: #f44336
}

.context-menu-item.danger:hover {
  background: #f443361a
}

.context-menu-separator {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0
}

.file-item.dragging {
  opacity: .5
}

.folder-content.drag-over {
  background: rgba(var(--accent-color-rgb), .1);
  border: 1px dashed var(--accent-color)
}

.folder-content {
  transition: max-height .2s ease-out;
  overflow: hidden
}

.folder-item.collapsed .folder-content {
  max-height: 0
}

.folder-item.expanded .folder-content {
  max-height: 1000px
}

@keyframes fadeIn {
  0% {
      opacity: 0;
      transform: translateY(-5px)
  }
  to {
      opacity: 1;
      transform: translateY(0)
  }
}

::selection {
  background: var(--accent-color);
  color: var(--accent-color-contrast)
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px
}

::-webkit-scrollbar-track {
  background: var(--bg-primary)
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 2px
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover)
}

.compiler-config {
  padding: 16px;
  overflow-y: auto
}

.form-group {
  margin-bottom: 16px
}

.form-group label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-weight: 500
}

.form-control {
  width: 100%;
  padding: 6px 8px;
  background: var(--control-bg);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 12px
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 1px var(--accent-color)
}

.form-control.input-error {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 1px #ff6b6b
}

.slider-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center
}

.range-input {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-color) var(--range-fill, 50%), rgba(255, 255, 255, .14) var(--range-fill, 50%), rgba(255, 255, 255, .14) 100%);
  border: 1px solid var(--input-border);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: box-shadow .2s, background .2s
}

.range-input:focus-visible {
  box-shadow: none
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent-color);
  border: 2px solid var(--bg-secondary);
  box-shadow: none
}

.range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-color);
  border: 2px solid var(--bg-secondary);
  box-shadow: none
}

.range-input::-moz-range-track {
  height: 10px;
  background: transparent;
  border: 0
}

.range-input::-webkit-slider-runnable-track {
  height: 10px;
  background: transparent
}

.range-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--input-border);
  background: rgba(var(--accent-color-rgb), .16);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2
}

.accent-control {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap
}

.accent-range {
  background: linear-gradient(90deg, #ff4d4d, #ffa600 17%, #f6ff00 33%, #3dff6f, #00c2ff 67%, #7a5bff 83%, #ff4dff);
  border-color: var(--input-border);
  flex: 1;
  min-width: 200px
}

.accent-range::-webkit-slider-runnable-track,
.accent-range::-moz-range-track {
  background: transparent
}

.accent-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px
}

.accent-preview {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--accent-color);
  box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), .25);
  flex-shrink: 0
}

.accent-hex {
  width: 110px
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 6px
}

.checkbox-group input[type=checkbox] {
  width: 14px;
  height: 14px
}

.checkbox-group label {
  margin: 0;
  font-size: 12px;
  cursor: pointer
}

.remix-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  width: 100%;
  justify-content: center
}

.remix-btn:disabled {
  opacity: .5;
  cursor: default
}

.remix-btn-primary {
  background: var(--accent-color);
  color: var(--accent-color-contrast)
}

.remix-btn-primary:hover:not(:disabled) {
  background: var(--accent-color-strong)
}

.remix-btn-orange {
  background: #f6851b;
  color: #fff
}

.remix-btn-orange:hover:not(:disabled) {
  background: #e2761b
}

.compile-button {
  margin-top: 8px
}

#compile-btn-label {
  min-width: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center
}

.compile-button.remix-btn-primary {
  background: #1f6ecf;
  color: #fff;
  font-weight: 700
}

.compile-button.remix-btn-primary:hover:not(:disabled) {
  background: #2d8cff
}

.compiler-runtime-info {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted)
}

.deploy-button {
  font-weight: 700
}

.deploy-btn-loading {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  animation: spin .75s linear infinite
}

.btn-spinner-red-white {
  border-color: #ffffff61;
  border-top-color: #fff
}

.deploy-config {
  padding: 0;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column
}

.deploy-form-section {
  padding: 16px;
  flex-shrink: 0
}

.contract-selector-row {
  display: none
}

.wallet-status-text {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted)
}

.constructor-params {
  margin-bottom: 16px
}

.param-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.param-input {
  padding: 6px 8px;
  background: var(--control-bg);
  border: 1px solid var(--input-border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 12px
}

.account-balance {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px
}

.deployed-contracts {
  margin-top: 0;
  max-height: none;
  overflow-y: visible;
  padding: 0 16px 8px;
  flex: 1;
  min-height: 0
}

.deployed-contracts h4 {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 12px
}

.contract-address-input {
  display: flex;
  gap: 8px;
  margin-bottom: 16px
}

.contract-address-input input {
  flex: 1
}

.contract-address-input button {
  width: auto;
  min-width: 80px
}

.contracts-list {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.deployed-contract {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px
}

.contract-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-elevated);
  cursor: pointer;
  min-height: 40px
}

.deployed-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px
}

.copy-address-btn {
  border: 1px solid rgba(255, 255, 255, .24);
  background: #1f6ecf;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  width: 108px;
  min-width: 108px;
  min-height: 28px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  cursor: pointer
}

.copy-address-btn:hover {
  background: #2d8cff
}

.contract-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
  word-break: break-word
}

.contract-name-file {
  font-style: italic
}

.contract-address-reminder {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 10px;
  font-family: Monaco, Menlo, Ubuntu Mono, monospace;
  word-break: break-all;
  opacity: .9
}

.contract-address-full {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: Monaco, Menlo, Ubuntu Mono, monospace;
  word-break: break-all;
  margin-bottom: 10px
}

.contract-address {
  font-size: 9px;
  color: var(--text-muted);
  font-family: Monaco, Menlo, Ubuntu Mono, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  margin-top: 2px
}

.contract-functions {
  padding: 8px;
  display: none;
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-panel)
}

.contract-functions.expanded {
  display: block
}

.bot-action-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 10px
}

.bot-action-btn {
  width: 100% !important;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2
}

.bot-action-btn-orange {
  background: #f6851b;
  color: #fff
}

.bot-action-btn-orange:hover:not(:disabled) {
  background: #e2761b
}

.bot-action-btn-blue {
  background: #1f6ecf;
  color: #fff
}

.bot-action-btn-blue:hover:not(:disabled) {
  background: #2d8cff
}

.bot-action-btn:disabled {
  background: #4a5568 !important;
  color: #a9b4c7 !important;
  opacity: 1 !important;
  cursor: default
}

.bot-action-btn.is-processing:disabled {
  opacity: 1 !important;
  color: #fff !important;
  cursor: default
}

.bot-action-btn.is-processing.bot-action-btn-orange:disabled {
  background: #c46814 !important
}

.bot-action-btn.is-processing.bot-action-btn-blue:disabled {
  background: #1a5eb3 !important
}

.bot-action-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .75s linear infinite
}

.bot-action-status {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-word
}

@media(max-width:640px) {
  .bot-action-grid {
      grid-template-columns: 1fr
  }
}

.function-item-horizontal {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box
}

.function-item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box
}

.function-button,
.function-button-small {
  background: #f6851b;
  color: #fff;
  border: 1px solid var(--border-color) !important;
  padding: 8px 8px 8px 6px !important;
  font-size: 10px !important;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s;
  white-space: nowrap;
  width: 50% !important;
  height: 36px !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  border-radius: 4px !important;
  margin: 0 !important;
  flex-shrink: 0;
  text-transform: none !important;
  letter-spacing: normal !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  min-width: 0 !important
}

.function-button.remix-btn-primary,
.function-button-small.remix-btn-primary {
  background: var(--accent-color) !important;
  color: var(--accent-color-contrast) !important
}

.function-button.remix-btn-orange,
.function-button-small.remix-btn-orange {
  background: #f6851b !important
}

.function-button:hover,
.function-button-small:hover {
  filter: brightness(1.1)
}

.function-inputs-horizontal {
  flex: 1;
  background: var(--control-bg);
  border: 1px solid #555555;
  border-radius: 4px;
  height: 36px;
  position: relative;
  display: flex;
  align-items: center;
  width: 40%
}

.function-param-dropdown {
  width: 100%;
  position: relative
}

.function-param-type {
  color: var(--text-secondary);
  font-size: 11px;
  font-family: Monaco, Menlo, Ubuntu Mono, monospace;
  cursor: pointer;
  padding: 8px;
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  transition: background-color .2s
}

.function-param-type:hover {
  background: var(--scrollbar-thumb)
}

.function-dropdown-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 10px;
  pointer-events: none
}

.function-param-input {
  width: 100%;
  background: var(--control-bg);
  border: 1px solid #555555;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 11px;
  padding: 8px 12px;
  font-family: Monaco, Menlo, Ubuntu Mono, monospace;
  display: none;
  height: 36px;
  box-sizing: border-box
}

.function-param-input.active {
  display: block
}

.function-param-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), .2)
}

.function-result {
  padding: 6px 8px;
  background: var(--bg-contrast);
  border-top: 1px solid var(--border-color);
  font-family: Monaco, Menlo, Ubuntu Mono, monospace;
  font-size: 10px;
  max-height: 80px;
  overflow-y: auto;
  word-break: break-all;
  line-height: 1.3;
  animation: fadeIn .2s ease-in
}

.function-result a {
  color: var(--accent-color);
  text-decoration: none;
  word-break: break-all
}

.function-result a:hover {
  text-decoration: underline
}

.compilation-output {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px;
  margin-top: 12px;
  font-family: Monaco, Menlo, Ubuntu Mono, monospace;
  font-size: 11px;
  max-height: 200px;
  overflow-y: auto
}

.output-placeholder {
  color: var(--text-muted);
  text-align: center;
  padding: 16px
}

.compilation-success {
  color: #4caf50
}

.compilation-error {
  color: #f44336
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center
}

.app-modal {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility .18s ease;
  padding: 16px
}

.app-modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #030812bd;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px)
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  border: 1px solid var(--border-color)
}

.app-modal-content {
  width: min(92vw, 520px);
  max-width: 520px;
  max-height: min(88vh, 520px);
  overflow-y: auto;
  padding: 18px;
  border-radius: 12px;
  border-color: var(--input-border);
  background: linear-gradient(180deg, #102139fa, #081425fa);
  box-shadow: 0 18px 42px #0000006b
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px
}

.modal-header h2 {
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600
}

.modal-body {
  margin-bottom: 24px
}

.modal-body p {
  color: var(--text-secondary);
  line-height: 1.5
}

.app-modal-body {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 12px
}

.app-modal-body p,
.app-modal-input-group {
  margin: 0
}

.app-modal-input {
  font-size: 14px
}

.app-modal-input-group[hidden] {
  display: none
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end
}

.modal-footer .remix-btn {
  width: auto;
  min-width: 100px;
  font-weight: 600
}

.app-modal-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .16)
}

.app-modal-footer .remix-btn {
  min-height: 40px
}

.wallet-selection-modal {
  max-width: 480px;
  width: 95%
}

.wallet-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--control-bg);
  border: 2px solid var(--input-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s ease;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500
}

.wallet-option:hover {
  background: var(--scrollbar-thumb);
  border-color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), .2)
}

.wallet-option:active {
  transform: translateY(0)
}

.wallet-icon {
  font-size: 24px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: #ffffff1a
}

.wallet-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary)
}

.wallet-install-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0
}

.wallet-install-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--accent-color);
  color: var(--accent-color-contrast);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s ease;
  border: 2px solid transparent
}

.wallet-install-btn:hover {
  background: var(--accent-color-strong);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), .3)
}

.wallet-install-btn:nth-child(2) {
  background: #0052ff;
  color: #fff
}

.wallet-install-btn:nth-child(2):hover {
  background: #0041cc
}

.wallet-install-btn:nth-child(3) {
  background: #3375bb;
  color: #fff
}

.wallet-install-btn:nth-child(3):hover {
  background: #2a5d99
}

.search-config {
  padding: 16px;
  overflow-y: auto
}

.search-input-group {
  display: flex;
  margin-bottom: 12px
}

.search-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--control-bg);
  border: 1px solid var(--input-border);
  border-radius: 4px 0 0 4px;
  color: var(--text-secondary);
  font-size: 13px
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 1px var(--accent-color)
}

.search-button {
  background: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: 0 4px 4px 0;
  color: var(--accent-color-contrast);
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color .2s
}

.search-button:hover {
  background: var(--accent-color-strong)
}

.search-options {
  display: flex;
  gap: 16px;
  margin-bottom: 12px
}

.search-option {
  display: flex;
  align-items: center;
  gap: 6px
}

.search-option input[type=checkbox] {
  width: 14px;
  height: 14px
}

.search-option label {
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer
}

.search-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px
}

.search-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 2px solid transparent;
  transition: all .2s
}

.search-tab:hover {
  color: var(--text-primary);
  background: var(--hover-bg)
}

.search-tab.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color)
}

.debugger-config {
  padding: 16px;
  overflow-y: auto
}

.debug-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px
}

.debug-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 2px solid transparent;
  transition: all .2s
}

.debug-tab:hover {
  color: var(--text-primary);
  background: var(--hover-bg)
}

.debug-tab.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color)
}

.simulation-debug-section {
  display: grid;
  gap: 12px
}

.simulation-debug-current {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-contrast)
}

.simulation-debug-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary)
}

.simulation-debug-row strong {
  color: var(--text-primary);
  font-family: Monaco, Menlo, Ubuntu Mono, Consolas, monospace
}

.settings-config {
  padding: 16px;
  overflow-y: auto
}

.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px
}

.settings-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 2px solid transparent;
  transition: all .2s
}

.settings-tab:hover {
  color: var(--text-primary);
  background: var(--hover-bg)
}

.settings-tab.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color)
}

.reset-panel {
  display: grid;
  gap: 12px
}

.reset-panel-info {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted)
}

.reset-all-btn {
  background: #872131;
  color: #fff
}

.reset-all-btn:hover:not(:disabled) {
  background: #a32a3d
}

.clear-terminal-settings-btn {
  background: #1f6ecf;
  color: #fff;
  font-weight: 700
}

.clear-terminal-settings-btn:hover:not(:disabled) {
  background: #2d8cff
}

.advanced-settings-list {
  display: grid;
  gap: 10px
}

.advanced-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: #ffffff05
}

.advanced-toggle-label {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35
}

.advanced-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none
}

.advanced-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none
}

.advanced-toggle-slider {
  position: relative;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff29;
  border: 1px solid var(--input-border);
  transition: background-color .2s ease, border-color .2s ease
}

.advanced-toggle-slider:after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s ease
}

.advanced-toggle input:checked+.advanced-toggle-slider {
  background: rgba(var(--accent-color-rgb), .72);
  border-color: rgba(var(--accent-color-rgb), .94)
}

.advanced-toggle input:checked+.advanced-toggle-slider:after {
  transform: translate(20px)
}

.advanced-toggle-state {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 22px;
  text-align: right
}

.advanced-toggle-state-on {
  display: none
}

.advanced-toggle input:checked~.advanced-toggle-state-off {
  display: none
}

.advanced-toggle input:checked~.advanced-toggle-state-on {
  display: inline;
  color: #51cf66
}

@keyframes fadeIn {
  0% {
      opacity: 0
  }
  to {
      opacity: 1
  }
}

@media(max-width:768px) {
  .search-options {
      flex-direction: column;
      gap: 8px
  }
  .debug-tabs,
  .settings-tabs {
      flex-wrap: wrap
  }
  .debug-tab,
  .settings-tab {
      flex: 1;
      min-width: 80px
  }
  .advanced-toggle-row {
      flex-direction: column;
      align-items: flex-start
  }
  .wallet-options {
      gap: 8px
  }
  .wallet-option {
      padding: 12px 16px;
      gap: 12px
  }
  .wallet-icon {
      font-size: 20px;
      width: 28px;
      height: 28px
  }
  .wallet-name {
      font-size: 13px
  }
  .wallet-install-btn {
      padding: 10px 14px;
      font-size: 13px
  }
}

@media(max-width:1200px) {
  .function-button,
  .function-button-small {
      font-size: 10px !important;
      padding: 6px !important
  }
}

@media(max-width:900px) {
  .function-button,
  .function-button-small {
      font-size: 9px !important;
      padding: 4px 8px !important
  }
}

.contract-functions::-webkit-scrollbar {
  width: 4px
}

.contract-functions::-webkit-scrollbar-track {
  background: var(--bg-primary)
}

.contract-functions::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 2px
}

.contract-functions::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover)
}

.deploy-config::-webkit-scrollbar {
  width: 6px
}

.deploy-config::-webkit-scrollbar-track {
  background: var(--bg-primary)
}

.deploy-config::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px
}

.deploy-config::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover)
}

.editor-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  height: 40px;
  display: flex;
  align-items: center;
  flex-shrink: 0
}

.editor-tabs {
  display: flex;
  height: 100%;
  flex: 1
}

.editor-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  transition: background-color .2s;
  position: relative
}

.editor-tab.active {
  background: var(--bg-primary);
  color: var(--text-primary)
}

.editor-tab:hover {
  background: var(--hover-bg)
}

.tab-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px
}

.tab-close:hover {
  background: var(--border-color);
  color: var(--text-primary)
}

.new-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-left: 1px solid var(--border-color);
  cursor: pointer;
  color: var(--text-muted);
  transition: background-color .2s;
  font-size: 0;
  -webkit-user-select: none;
  user-select: none
}

.new-tab-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary)
}

.new-tab-btn:before,
.new-tab-btn:after {
  content: "";
  position: absolute;
  top: calc(50% - .5px);
  left: 50%;
  transform: translate(-50%, -50%);
  background: currentColor;
  border-radius: 1px;
  pointer-events: none
}

.new-tab-btn:before {
  width: 10px;
  height: 1px
}

.new-tab-btn:after {
  width: 1px;
  height: 10px
}

.editor-content {
  flex: 1;
  position: relative;
  display: flex;
  overflow: hidden;
  min-width: 0
}

.editor-textarea-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary)
}

.editor-code-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  background: linear-gradient(180deg, #040e1ed9, #020a18eb)
}

.editor-highlight {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 16px 16px 56px;
  pointer-events: none;
  overflow: auto;
  white-space: pre;
  font-family: Monaco, Menlo, Ubuntu Mono, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  tab-size: 4;
  color: #d4d4d4;
  z-index: 1;
  scrollbar-width: none
}

.editor-highlight::-webkit-scrollbar {
  width: 0;
  height: 0
}

.editor-idle-caret {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 2px;
  height: 1.6em;
  background: #d4e4ff;
  z-index: 3;
  pointer-events: none;
  display: none
}

.editor-idle-caret.visible {
  display: block;
  animation: editorIdleCaretBlink 1s step-end infinite
}

@keyframes editorIdleCaretBlink {
  0%,
  49% {
      opacity: 1
  }
  50%,
  to {
      opacity: 0
  }
}

.editor-empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  transition: opacity .2s ease
}

.editor-empty-state.visible {
  opacity: 1
}

.editor-line-numbers {
  width: 56px;
  flex-shrink: 0;
  padding: 16px 10px 56px 0;
  border-right: 1px solid var(--border-color);
  background: #ffffff08;
  color: var(--text-muted);
  text-align: right;
  font-family: Monaco, Menlo, Ubuntu Mono, Consolas, monospace;
  font-size: 12px;
  font-style: italic;
  line-height: 1.6;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
  overflow: hidden
}

.editor-line-number {
  height: 1.6em
}

body.light-theme .editor-line-numbers {
  background: #f1f5fc;
  color: #6f7f95;
  border-right-color: #d5deed
}

.editor-minimap-column {
  width: var(--editor-minimap-width);
  flex: 0 0 var(--editor-minimap-width);
  border-left: 0;
  background: color-mix(in srgb, var(--bg-primary) 94%, #0d2445 6%);
  min-height: 0
}

.editor-minimap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: color-mix(in srgb, var(--bg-primary) 95%, #123259 5%);
  border: 0;
  box-shadow: none;
  overflow: hidden;
  z-index: 5;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none
}

.editor-minimap.hidden {
  opacity: 0;
  pointer-events: none
}

.editor-minimap-content {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0 4px;
  white-space: pre;
  color: #add6ffb8;
  font-family: Monaco, Menlo, Ubuntu Mono, Consolas, monospace;
  font-size: 1.9px;
  line-height: 1;
  transform-origin: top left;
  pointer-events: none;
  letter-spacing: 0
}

.editor-minimap-viewport {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 20px;
  border: 0;
  border-left: 2px solid rgba(110, 162, 228, .78);
  border-right: 2px solid rgba(110, 162, 228, .78);
  background: #4c84cb1f;
  pointer-events: none;
  display: none
}

body.light-theme .editor-highlight {
  color: #142033
}

body.light-theme .editor-textarea-wrap {
  background: #f8fbff
}

body.light-theme .editor-code-wrap {
  background: linear-gradient(180deg, #fbfdff, #f3f8ff)
}

body.light-theme .editor-minimap-column {
  border-left: 0;
  background: #f1f6fd
}

body.light-theme .editor-minimap {
  background: #eef4fc;
  box-shadow: none
}

body.light-theme .editor-minimap-content {
  color: #304e76bf
}

body.light-theme .editor-minimap-viewport {
  border-left-color: #4776b2a3;
  border-right-color: #4776b2a3;
  background: #6293d21f
}

.editor-status {
  position: absolute;
  bottom: 8px;
  right: calc(var(--editor-minimap-width) + 18px);
  background: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: Monaco, Menlo, Ubuntu Mono, monospace;
  z-index: 10
}

.editor-font-controls-floating {
  position: absolute;
  top: 8px;
  right: calc(var(--editor-minimap-width) + 18px);
  display: inline-flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  z-index: 10
}

.editor-font-floating-btn {
  min-width: 28px;
  height: 28px;
  border: 0;
  padding: 0 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: Monaco, Menlo, Ubuntu Mono, monospace;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer
}

.editor-font-floating-btn+.editor-font-floating-btn {
  border-left: 1px solid var(--border-color)
}

.editor-font-floating-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary)
}

.CodeMirror {
  height: 100% !important;
  background: var(--bg-primary) !important;
  color: #d4d4d4 !important;
  font-family: Monaco, Menlo, Ubuntu Mono, Consolas, monospace !important;
  font-size: 12px !important;
  line-height: 1.6 !important;
  width: 100% !important;
  min-width: 0 !important
}

.CodeMirror-gutters {
  background: var(--bg-primary) !important;
  border-right: 1px solid var(--border-color) !important
}

.CodeMirror-linenumber {
  color: #858585 !important;
  padding-right: 16px !important
}

.CodeMirror-cursor {
  border-left: 2px solid #d4d4d4 !important
}

.CodeMirror-selected {
  background: #ffffff1a !important
}

.CodeMirror-focused .CodeMirror-selected {
  background: #ffffff26 !important
}

.CodeMirror-activeline-background {
  background: #ffffff0f !important
}

.cm-keyword {
  color: #51cf66 !important;
  font-weight: 500 !important
}

.cm-def,
.cm-type {
  color: #74c0fc !important
}

.cm-builtin {
  color: #9b59b6 !important;
  font-weight: 500 !important
}

.cm-variable,
.cm-variable-2 {
  color: #d4d4d4 !important
}

.cm-variable-3,
.cm-number {
  color: #74c0fc !important
}

.cm-string,
.cm-string-2 {
  color: #ffe066 !important
}

.cm-comment {
  color: #629755 !important;
  font-style: italic !important
}

.cm-operator,
.cm-bracket,
.cm-punctuation {
  color: #d4d4d4 !important
}

.cm-attribute {
  color: #9cdcfe !important
}

.cm-meta {
  color: #74c0fc !important
}

.cm-atom {
  color: #ff6b6b !important
}

.cm-error {
  background: #ff6b6b33 !important;
  color: #ff6b6b !important;
  border-bottom: 2px wavy #ff6b6b !important
}

.CodeMirror-matchingbracket {
  background: #74c0fc33 !important;
  color: #74c0fc !important;
  border: 1px solid #74c0fc !important;
  border-radius: 2px !important
}

.CodeMirror-nonmatchingbracket {
  background: #ff6b6b33 !important;
  color: #ff6b6b !important;
  border: 1px solid #ff6b6b !important;
  border-radius: 2px !important
}

.CodeMirror-foldmarker {
  background: var(--accent-color) !important;
  border: 1px solid var(--accent-color) !important;
  border-radius: 3px !important;
  color: #fff !important;
  font-family: Monaco, monospace !important;
  padding: 0 4px !important;
  font-size: 10px !important;
  font-weight: 700 !important
}

.CodeMirror-foldgutter {
  width: 16px !important
}

.CodeMirror-foldgutter-open,
.CodeMirror-foldgutter-folded {
  color: #666 !important;
  cursor: pointer !important
}

.CodeMirror-foldgutter-open:hover,
.CodeMirror-foldgutter-folded:hover {
  color: var(--accent-color) !important
}

.cm-searching {
  background: #ffd43b4d !important;
  border: 1px solid #ffd43b !important;
  border-radius: 2px !important
}

.CodeMirror-search-match {
  background: #74c0fc4d !important;
  border: 1px solid #74c0fc !important;
  border-radius: 2px !important
}

.CodeMirror-scroll::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important
}

.CodeMirror-scroll::-webkit-scrollbar-track {
  background: var(--bg-primary) !important
}

.CodeMirror-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb) !important;
  border-radius: 4px !important
}

.CodeMirror-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover) !important
}

.CodeMirror-vscrollbar::-webkit-scrollbar,
.CodeMirror-hscrollbar::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important
}

.CodeMirror-vscrollbar::-webkit-scrollbar-track,
.CodeMirror-hscrollbar::-webkit-scrollbar-track {
  background: var(--bg-primary) !important
}

.CodeMirror-vscrollbar::-webkit-scrollbar-thumb,
.CodeMirror-hscrollbar::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb) !important;
  border-radius: 4px !important
}

.CodeMirror-hints {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 8px #0000004d !important;
  font-family: Monaco, Menlo, monospace !important;
  max-height: 200px !important;
  overflow-y: auto !important
}

.CodeMirror-hint {
  color: #d4d4d4 !important;
  padding: 6px 8px !important;
  border-radius: 2px !important;
  transition: background-color .2s !important;
  font-size: 12px !important
}

.CodeMirror-hint:hover {
  background: var(--hover-bg) !important
}

.CodeMirror-hint-active {
  background: var(--accent-color) !important;
  color: #fff !important
}

#code-editor {
  width: 100% !important;
  height: 100% !important;
  overflow: auto !important
}

.CodeMirror-lines {
  padding: 4px 0 !important
}

.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
  background-color: var(--bg-primary) !important
}

.syntax-error {
  background: #ff6b6b33 !important;
  border-bottom: 2px wavy #ff6b6b !important
}

@keyframes saveNotification {
  0% {
      opacity: 0;
      transform: translate(100%)
  }
  10% {
      opacity: 1;
      transform: translate(0)
  }
  90% {
      opacity: 1;
      transform: translate(0)
  }
  to {
      opacity: 0;
      transform: translate(100%)
  }
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0;
  height: 25px;
  flex-shrink: 0
}

.terminal-tabs {
  display: flex;
  height: 100%
}

.terminal-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border-right: 1px solid var(--border-color);
  transition: none
}

.terminal-tab.active {
  background: var(--bg-primary);
  color: var(--text-primary)
}

.terminal-tab:not(.active):hover {
  background: transparent;
  color: var(--text-secondary)
}

.terminal-actions {
  padding: 0 8px;
  display: flex;
  gap: 4px
}

#clear-terminal-btn {
  display: none
}

.terminal-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 3px;
  transition: background-color .2s;
  display: flex;
  align-items: center;
  justify-content: center
}

.terminal-btn:hover {
  background: var(--hover-bg);
  color: var(--text-primary)
}

.terminal-content {
  flex: 1;
  padding: 16px;
  font-family: Monaco, Menlo, Ubuntu Mono, Consolas, monospace;
  font-size: 12px;
  line-height: 1.12;
  letter-spacing: -.015em;
  font-variant-ligatures: none;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-contrast) 100%);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 0 0 4px 4px;
  user-select: text;
  -webkit-user-select: text
}

.terminal-welcome {
  color: var(--accent-color-soft);
  margin-bottom: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  text-shadow: 0 0 4px rgba(var(--accent-color-soft-rgb), .3);
  white-space: nowrap
}

.terminal-log {
  margin: 1px 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.08;
  user-select: text;
  -webkit-user-select: text
}

.terminal-type {
  color: inherit;
  white-space: nowrap;
  display: inline;
  margin-right: 6px
}

.terminal-message {
  display: inline;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text
}

.terminal-log:hover {
  background: transparent;
  transform: none
}

.terminal-error {
  color: #ffb347;
  background: transparent;
  box-shadow: none
}

.terminal-success {
  color: #51cf66;
  background: transparent;
  box-shadow: none
}

.terminal-info {
  color: #fff;
  background: transparent;
  box-shadow: none
}

.terminal-warning {
  color: #ffd43b;
  background: transparent;
  box-shadow: none
}

.terminal-log a {
  color: var(--accent-color-soft);
  text-decoration: none;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(var(--accent-color-soft-rgb), .1);
  border: 1px solid rgba(var(--accent-color-soft-rgb), .3);
  transition: all .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  margin-left: 4px
}

.terminal-log a:hover {
  background: rgba(var(--accent-color-soft-rgb), .2);
  border-color: var(--accent-color-soft);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--accent-color-soft-rgb), .3);
  text-shadow: 0 0 4px rgba(var(--accent-color-soft-rgb), .5)
}

.terminal-log a:before {
  content: ">";
  font-size: 10px
}

.terminal-timestamp {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  margin-right: 8px;
  background: none;
  padding: 0;
  border-radius: 0;
  white-space: nowrap;
  display: inline
}

.terminal-log code,
.terminal-log .hash {
  background: #ffffff1a;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: Monaco, Menlo, Ubuntu Mono, Consolas, monospace;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, .1)
}

.terminal-content::-webkit-scrollbar {
  width: 8px;
  height: 8px
}

.terminal-content::-webkit-scrollbar-track {
  background: var(--bg-contrast);
  border-radius: 4px
}

.terminal-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--accent-color-soft), var(--accent-color));
  border-radius: 4px
}

.terminal-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--accent-color-soft), var(--accent-color-strong))
}

html,
body,
#app {
  height: 100%
}

#app {
  width: 100%
}

.site-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none
}

#code-editor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  resize: none;
  outline: none;
  padding: 16px 16px 56px;
  background: transparent;
  color: transparent;
  caret-color: #d4e4ff;
  font-family: Monaco, Menlo, Ubuntu Mono, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 4;
  z-index: 2;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal
}

#code-editor::-webkit-scrollbar {
  width: 0;
  height: 0
}

body.light-theme #code-editor {
  caret-color: #1b2a41
}

body.light-theme .editor-idle-caret {
  background: #1b2a41
}

body.light-theme .terminal-content {
  background: linear-gradient(135deg, #eef4fc, #e3ebf7)
}

.sol-token-keyword {
  color: #c586c0;
  font-weight: 600
}

.sol-token-type {
  color: #4ec9b0
}

.sol-token-definition {
  color: #61afef;
  font-weight: 600
}

.sol-token-builtin {
  color: #d19a66
}

.sol-token-string {
  color: #ce9178
}

.sol-token-number {
  color: #b5cea8
}

.sol-token-comment {
  color: #6a9955;
  font-style: italic
}

.sol-token-operator {
  color: #d4d4d4
}

.sol-token-bracket {
  color: #ffd68a
}

body.light-theme .sol-token-keyword {
  color: #9d1aa6
}

body.light-theme .sol-token-type {
  color: #036e63
}

body.light-theme .sol-token-definition {
  color: #0058c9
}

body.light-theme .sol-token-builtin {
  color: #8a4b00
}

body.light-theme .sol-token-string {
  color: #b13e00
}

body.light-theme .sol-token-number {
  color: #2c7a00
}

body.light-theme .sol-token-comment {
  color: #5f7e3a
}

body.light-theme .sol-token-operator {
  color: #273349
}

body.light-theme .sol-token-bracket {
  color: #9a6200
}

.compilation-meta {
  margin-bottom: 8px;
  color: var(--text-muted)
}

.compilation-line {
  margin-bottom: 6px;
  line-height: 1.35
}

.artifact-preview {
  margin-top: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px;
  background: var(--bg-contrast)
}

.artifact-preview summary {
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 8px
}

.artifact-text {
  margin: 0;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary)
}

.debug-panel,
.settings-panel {
  display: none
}

.debug-panel.active,
.settings-panel.active {
  display: block
}

.terminal-btn {
  font-family: Monaco, Menlo, Ubuntu Mono, Consolas, monospace;
  font-size: 11px
}

.settings-content {
  min-height: 220px
}

@media(max-width:1024px) {
  :root {
      --editor-minimap-width: 86px
  }
  .remix-icon-panel {
      width: 118px
  }
  .remix-sidebar {
      width: 290px;
      min-width: 250px
  }
  .current-file-name {
      font-size: 12px
  }
  .remix-container.mobile-panel-mode-editor .horizontal-resizer,
  .remix-container.mobile-panel-mode-editor .remix-terminal {
      display: none
  }
  .remix-container.mobile-panel-mode-editor .remix-editor {
      display: flex;
      flex: 1 1 auto
  }
  .remix-container.mobile-panel-mode-terminal .horizontal-resizer,
  .remix-container.mobile-panel-mode-terminal .remix-editor {
      display: none
  }
  .remix-container.mobile-panel-mode-terminal .remix-terminal {
      display: flex;
      flex: 1 1 auto;
      height: auto !important;
      border-top: 0
  }
  .remix-container.mobile-panel-mode-none .vertical-resizer,
  .remix-container.mobile-panel-mode-none .right-section {
      display: none
  }
  .remix-container.mobile-panel-mode-none .remix-sidebar {
      width: 100% !important;
      min-width: 0;
      flex: 1 1 auto
  }
}

@media(max-width:760px) {
  .editor-minimap-column {
      display: none
  }
  .editor-highlight,
  #code-editor {
      padding-right: 16px
  }
  .editor-status,
  .editor-font-controls-floating {
      right: 16px
  }
}

@media(max-width:860px) {
  .remix-header {
      height: auto;
      gap: 8px;
      flex-wrap: wrap;
      padding: 8px 10px
  }
  .header-center {
      order: 3;
      width: 100%;
      justify-content: flex-start
  }
  .header-center,
  .header-right {
      display: none
  }
  .remix-header {
      height: 44px;
      gap: 0;
      flex-wrap: nowrap;
      padding: 5px 10px
  }
  .header-left {
      min-width: 0;
      flex: 1 1 auto
  }
  .network-text {
      max-width: 140px
  }
  .remix-main {
      flex-direction: column
  }
  .remix-icon-panel {
      width: 100%;
      height: 56px;
      border-right: 0;
      border-bottom: 1px solid var(--border-color);
      flex-direction: row;
      justify-content: flex-start;
      overflow-x: auto;
      padding: 4px 6px
  }
  .icon-group {
      flex-direction: row;
      gap: 6px
  }
  .icon-item {
      width: auto;
      min-width: 112px;
      min-height: 46px;
      padding: 8px;
      gap: 8px
  }
  .icon-separator {
      width: 1px;
      height: 28px;
      margin: 8px 4px;
      flex-shrink: 0
  }
  .icon-label {
      font-size: 11px
  }
  .github-corner {
      left: 10px;
      bottom: 10px
  }
  .main-content {
      flex-direction: column
  }
  .remix-sidebar {
      width: 100%;
      min-width: 0;
      height: clamp(264px, 46vh, 430px);
      border-right: 0;
      border-bottom: 1px solid var(--border-color)
  }
  .vertical-resizer {
      display: none
  }
  .right-section {
      min-height: 0;
      width: 100%
  }
  .remix-terminal {
      height: clamp(160px, 30vh, 260px)
  }
}

@media(max-width:640px) {
  .remix-header {
      gap: 6px;
      padding: 7px 8px
  }
  .logo-text {
      font-size: 12px;
      max-width: calc(100vw - 72px)
  }
  .header-right {
      width: 100%;
      justify-content: flex-start
  }
  .current-file-name {
      font-size: 11px;
      opacity: .9
  }
  .icon-item {
      min-width: 96px;
      min-height: 44px;
      padding: 7px
  }
  .icon-label {
      font-size: 10px
  }
  .plugin-header {
      padding: 12px
  }
  .app-modal {
      align-items: flex-start;
      justify-content: center;
      padding-top: max(14px, env(safe-area-inset-top));
      padding-right: 10px;
      padding-bottom: max(14px, env(safe-area-inset-bottom));
      padding-left: 10px
  }
  .app-modal-content {
      width: 100%;
      max-width: none;
      max-height: calc(100dvh - max(28px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
      padding: 14px;
      border-radius: 10px
  }
  .app-modal-header {
      margin-bottom: 12px
  }
  .app-modal-header h2 {
      font-size: 22px
  }
  .app-modal-input {
      font-size: 16px;
      min-height: 42px
  }
  .app-modal-footer {
      margin-top: 10px;
      padding-top: 10px
  }
  .app-modal-footer .remix-btn {
      flex: 1 1 0;
      min-width: 0;
      min-height: 44px
  }
}

.search-results {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto
}

.search-placeholder {
  color: var(--text-muted);
  padding: 10px 2px;
  font-size: 12px
}

.search-result-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  border-radius: 4px;
  color: var(--text-secondary);
  padding: 8px 10px;
  cursor: pointer;
  display: grid;
  gap: 4px
}

.search-result-item:hover {
  background: var(--hover-bg);
  color: var(--text-primary)
}

.search-result-title {
  font-size: 12px;
  font-weight: 600
}

.search-result-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.tab-label {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.editor-tabs {
  min-width: 0;
  overflow-x: auto
}

.compilation-output .artifact-text {
  max-height: 160px
}

.is-resizing-col,
.is-resizing-col * {
  cursor: col-resize !important;
  -webkit-user-select: none !important;
  user-select: none !important
}

.is-resizing-row,
.is-resizing-row * {
  cursor: row-resize !important;
  -webkit-user-select: none !important;
  user-select: none !important
}

.gradient-controls {
  display: grid;
  gap: 8px
}

.gradient-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center
}

.gradient-row label {
  margin: 0;
  font-size: 12px
}

.gradient-row input[type=color] {
  width: 44px;
  height: 28px;
  border: 1px solid var(--input-border);
  border-radius: 4px;
  background: var(--control-bg);
  padding: 0
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%
}

.color-dot-base {
  background: var(--bg-gradient-base)
}

.gradient-helper-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  padding-left: 18px
}

.bot-buttons-column {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.bot-btn {
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .1s
}

.bot-btn:disabled {
  opacity: .5;
  cursor: default
}

.remix-btn-secondary {
  background: #5a5a5a;
  color: #fff
}

.remix-btn-secondary:hover:not(:disabled) {
  background: #6a6a6a
}

.remix-btn-invalid {
  background: #8b5a5a;
  color: #fff
}

.remix-btn-invalid:disabled {
  opacity: .7;
  cursor: default
}

.bot-btn.remix-btn-orange {
  background: #f6851b;
  color: #fff
}

.bot-btn.remix-btn-orange:hover:not(:disabled) {
  background: #e2761b;
  transform: translateY(-1px)
}

.bot-btn.remix-btn-primary {
  background: var(--accent-color);
  color: var(--accent-color-contrast)
}

.bot-btn.remix-btn-primary:hover:not(:disabled) {
  background: var(--accent-color-strong);
  transform: translateY(-1px)
}

.bot-status {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin .8s ease-in-out infinite;
  margin-right: 6px;
  vertical-align: middle
}

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

.bot-btn.remix-btn-success {
  background: #22c55e;
  color: #fff
}

.bot-btn.remix-btn-success:hover:not(:disabled) {
  background: #16a34a;
  transform: translateY(-1px)
}

.bot-btn.remix-btn-warning {
  background: #f59e0b;
  color: #fff
}

.bot-btn.remix-btn-warning:hover:not(:disabled) {
  background: #d97706;
  transform: translateY(-1px)
}

.liquidity-display {
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border-color)
}

.liquidity-info {
  display: flex;
  flex-direction: column;
  gap: 8px
}

.liquidity-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px
}

.liquidity-label {
  color: var(--text-muted)
}

.liquidity-value {
  color: var(--text-primary);
  font-weight: 600;
  font-family: Monaco, Menlo, Ubuntu Mono, Consolas, monospace
}

.pnl-positive {
  color: #22c55e
}

.pnl-negative {
  color: #ef4444
}

.blocked-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color)
}

.blocked-indicator {
  color: #f59e0b;
  font-size: 11px;
  font-weight: 500
}

.terminal-log .terminal-message span[style*="color: #00ffff"] {
  color: #0ff
}

.terminal-log .terminal-message span[style*="color: #00ff00"] {
  color: #0f0
}