  :root {
      --bg: #0d1117;
      --fg: #e6edf3;
      --card: #0f1623;
      --acc: #58a6ff;
      --err: #ff6b6b;
      --ok: #3ddc97;
      --b: #8c929e;
      --in: #0b1320;
      --ring: #2a6ae6;

      --info-bg: #0b1326;
      --info-border: #21345b;
      --info-shadow: 0 20px 50px rgba(0, 0, 0, .6), 0 0 0 1px rgba(42, 106, 230, .15) inset;
  }



  main {
      max-width: 1200px;
      margin: 0 auto;
      padding: 16px;
      display: grid;
      gap: 16px
  }

  .card {
      border: 1px solid var(--b);
      border-radius: 14px;
      padding: 16px
  }

  .row {
      display: grid;
      gap: 12px
  }

  .grid-2 {
      grid-template-columns: 1fr 1fr
  }

  .grid-3 {
      grid-template-columns: 1fr 1fr 1fr
  }

  label {
      font-weight: 600;
      color: var(--mut)
  }

  textarea,
  input[type="text"],
  select {
      width: 100%;
      height: 45px;
      background: var(--in);
      color: var(--fg);
      border: 1px solid var(--b);
      border-radius: 10px;
      padding: 12px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      outline: none
  }

  textarea {
      min-height: 220px;
      resize: vertical
  }

  textarea:focus,
  input[type="text"]:focus,
  select:focus {
      border-color: var(--ring);
      box-shadow: 0 0 0 3px rgba(88, 166, 255, .2)
  }

  #build {
      width: 300px;
      margin: 0px auto;
      margin-top: 20px;
      padding: 16px 32px;
      background: linear-gradient(135deg, #67aff3 0%, #2264a1 100%);
      border: none;
      color: white;
      font-size: 16px;
      font-weight: 600;
      border-radius: 50px;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 8px 25px rgba(102, 177, 234, 0.3);
      position: relative;
      overflow: hidden;
  }

  #build:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(74, 139, 189, 0.3);
  }

  #build:disabled {
      opacity: .5;
      cursor: not-allowed
  }

  #build::before {
      content: '';
      position: absolute;
      top: 0;
      left: -100%;
      width: 100%;
      height: 100%;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
      transition: left 0.5s;
  }

  #build:hover::before {
      left: 100%;
  }

  #msg {
      width: 300px;
      margin: 0px auto;
  }

  .hint {
      font-size: 12px;
  }

  .status {
      padding: 10px;
      border-radius: 10px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace
  }

  .ok {
      background: rgba(61, 220, 151, .1);
      border: 1px solid rgba(61, 220, 151, .3)
  }

  .err {
      background: rgba(255, 107, 107, .1);
      border: 1px solid rgba(255, 107, 107, .3)
  }

  code {
      background: var(--in);
      padding: 2px 6px;
      border-radius: 6px;
      border: 1px solid var(--b)
  }

  .flex {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center
  }

  .ctl {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 10px;
      background: #0e172a;
      border: 1px solid var(--b);
      border-radius: 999px;
      color: #ffffff;
      cursor: pointer;
      transition: all 0.3s ease;
  }

  .ctl:hover {
      background: #5fb9f6;
      border-color: #5fb9f6;
  }

  .ctl input {
      appearance: none;
      width: 16px;
      height: 16px;
      border: 1.5px solid #2b3a55;
      border-radius: 4px;
      background: #0b1320;
      outline: none;
      cursor: pointer
  }

  .ctl input[type="radio"] {
      border-radius: 999px
  }

  .ctl input:checked {
      background: #5fb9f6;
      border-color: #10204c;
      box-shadow: inset 0 0 0 4px #3a63d1
  }

  .toggle {
      display: inline-flex;
      width: max-content;
      height: 45px;
      margin-top: 10px;
      align-items: center;
      gap: 10px;
      background: #0e172a;
      border: 1px solid var(--b);
      padding: 8px 12px;
      border-radius: 999px;
      user-select: none;
      cursor: pointer;
      color: #ffffff;
  }

  .toggle input {
      appearance: none;
      width: 28px;
      height: 16px;
      border-radius: 999px;
      background: #c3cfeb;
      position: relative;
      outline: none
  }

  .toggle input::after {
      content: "";
      position: absolute;
      top: 2px;
      left: 2px;
      width: 12px;
      height: 12px;
      border-radius: 50%;
      background: #122040;
      transition: all .15s
  }

  .toggle input:checked {
      background: #559aff;
  }

  .toggle input:checked::after {
      left: 14px;
      background: #122040
  }

  .disabled {
      opacity: .5;
      pointer-events: none
  }

  select {
      appearance: none;
      background-image: linear-gradient(45deg, transparent 50%, #7aa2ff 50%), linear-gradient(135deg, #7aa2ff 50%, transparent 50%);
      background-position: calc(100% - 20px) calc(1em - 2px), calc(100% - 15px) calc(1em - 2px);
      background-size: 5px 5px, 5px 5px;
      background-repeat: no-repeat;
      margin-top: 10px !important;
  }

  details {
      border: 1px solid var(--b);
      border-radius: 10px;
      padding: 10px;
      background: #0f1a31;
      color: #ffffff;
  }

  details summary {
      cursor: pointer;
      color: var(--fg);
      font-weight: 700
  }

  ul.flags {
      margin: 10px 0 0 16px;
      padding: 0
  }

  ul.flags li {
      margin: 6px 0
  }

  /* Single-element editor (no overlay) */
  .bat-editor {
      min-height: 220px;
      max-height: 400px;
      overflow: auto;
      resize: vertical;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-size: 14px;
      line-height: 1.45;
      border-radius: 10px;
      padding: 12px;
      border: 1px solid var(--b);
      background: var(--in);
      color: var(--fg);
      white-space: pre-wrap;
      word-break: break-word;
      outline: none;
  }

  .bat-editor:focus {
      border-color: var(--ring);
      box-shadow: 0 0 0 3px rgba(88, 166, 255, .2)
  }

  .bat-editor:empty:before {
      content: attr(data-placeholder);
  }

  .tok-comment {
      color: #8b949e;
  }

  .tok-label {
      color: #ffa657;
  }

  .tok-key {
      color: #d2a8ff;
  }

  .tok-var,
  .tok-flag {
      color: #79c0ff;
  }

  .tok-param {
      color: #79c0ff;
      font-weight: 600;
  }

  .tok-str {
      color: #a5d6ff;
  }

  .tok-op {
      color: #ff7b72;
  }

  .tok-num {
      color: #c9d1d9;
  }

  #batEditor.placeholder::before {
      content: attr(data-placeholder);
  }


  .upload-btn {
      padding: 8px 16px;
      background: #5fb9f6;
      color: white;
      border: none;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      gap: 6px;
  }

  .upload-btn:hover {
      background: #2980b9;
      transform: translateY(-1px);
  }

  /* ===== Info Area (hover to open, click to pin) ===== */
  .info-wrap {
      position: absolute;
      left: 20px;
      top: 120px;
  }


  .info-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      border-radius: 999px;
      border: 1px solid var(--b);
      background: #0e172a;
      color: #98b7ff;
      cursor: pointer;
      outline: none;
      font-weight: 900;
      font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
      margin-bottom: 10px;
  }

  .info-btn:focus-visible {
      box-shadow: 0 0 0 3px rgba(88, 166, 255, .35);
      border-color: var(--ring);
  }

  .info-bubble {
      position: absolute;
      left: 0px;
      top: calc(100%);
      width: min(880px, calc(100vw - 24px));
      max-height: min(70vh, 720px);
      overflow: auto;
      background: var(--info-bg);
      border: 1px solid var(--info-border);
      box-shadow: var(--info-shadow);
      border-radius: 14px;
      padding: 14px;
      opacity: 0;
      transform: translateY(-4px);
      pointer-events: none;
      transition: opacity .12s ease, transform .12s ease;
      z-index: 30;
  }

  .info-wrap:hover .info-bubble,
  .info-wrap:focus-within .info-bubble,
  .info-wrap[data-pinned="1"] .info-bubble {
      opacity: 1;
      transform: translateY(0);
      pointer-events: auto;
  }

  .info-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--b);
      margin-bottom: 10px;
  }

  .info-bubble-title {
      font-size: 14px;
      font-weight: 800;
      color: #c8d9ff;
  }

  .info-actions {
      display: inline-flex;
      gap: 6px;
  }

  .info-pill {
      border: 1px solid var(--b);
      background: #0d1a34;
      color: #a9c1ff;
      border-radius: 999px;
      font-size: 12px;
      padding: 7px 8px;
      user-select: none;
  }

  .info-pin {
      background: #112149;
      border: 1px solid var(--b);
      color: #cbd7ff;
      padding: 6px 8px;
      border-radius: 8px;
      cursor: pointer;
  }

  .info-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
  }

  @media (min-width: 840px) {
      .info-grid {
          grid-template-columns: 1.2fr 1fr;
      }
  }

  .header-info-section {
      background: #0b162e;
      border: 1px solid var(--b);
      border-radius: 10px;
      padding: 12px;
      min-width: 100px;
  }

  .header-info-section h3 {
      margin: 0 0 8px;
      font-size: 13px;
      color: #b8c8ff;
  }

  .header-info-section ul {
      margin: 6px 0 0 18px;
      padding: 0;
  }

  .header-info-section li {
      margin: 6px 0;
      color: #c7d4ff;
  }

  .header-info-section pre {
      margin: 8px 0 0 0;
      padding: 10px;
      background: #0a1430;
      border: 1px solid var(--b);
      border-radius: 8px;
      overflow: auto;
      font-size: 12px;
      line-height: 1.35;
      color: #d7e3ff;
  }

  .kbd {
      display: inline-block;
      border: 1px solid var(--b);
      background: #0f1f43;
      padding: 1px 6px;
      border-radius: 6px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-size: 12px;
      color: #cfe0ff;
  }

  .bat-editor.drag-over {
      background: #0f3151;
      border: 2px dashed #3182ce;
  }

  .bat-editor.drag-over::after {
      content: '📁 Drop your JavaScript file here';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: #3182ce;
      color: white;
      padding: 20px 30px;
      border-radius: 10px;
      font-weight: 600;
      font-size: 16px;
      pointer-events: none;
      z-index: 10;
      animation: pulse 1s infinite;
  }

  .bat-editor.drag-error {
      background: #2d1b1b;
      border: 2px dashed #ff5555;
      transform: scale(1.02);
  }

  .bat-editor.drag-error::after {
      content: '❌ Multiple files detected - drop one file only';
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      background: rgba(255, 85, 85, 0.9);
      color: white;
      padding: 20px 30px;
      border-radius: 10px;
      font-weight: 600;
      font-size: 16px;
      pointer-events: none;
      z-index: 10;
      animation: shake 0.5s ease-in-out;
  }

  @keyframes shake {

      0%,
      100% {
          transform: translate(-50%, -50%) translateX(0);
      }

      25% {
          transform: translate(-50%, -50%) translateX(-5px);
      }

      75% {
          transform: translate(-50%, -50%) translateX(5px);
      }
  }

  @keyframes pulse {

      0%,
      100% {
          opacity: 0.8;
          transform: translate(-50%, -50%) scale(1);
      }

      50% {
          opacity: 1;
          transform: translate(-50%, -50%) scale(1.05);
      }

  }


  @media (max-width: 840px) {
      .grid-3 {
          grid-template-columns: none;
      }

      select,
      .toggle {
          margin-top: 0px !important;
      }

      .flexBox {
          gap: 0px;
      }

      .flexBox label {
          display: flex;
          align-items: center;
          height: 50px;
      }

      .upload-btn {
          padding: 4px 10px;
      }
  }