* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
    body { background-color: #0b111e; color: #e2e8f0; overflow: hidden; height: 100vh; width: 100vw; display: flex; flex-direction: column; }
    
    #topbar {
      min-height: 56px; flex-shrink: 0; flex-wrap: wrap; gap: 8px; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(8px);
      border-bottom: 1px solid #334155; display: flex; align-items: center; justify-content: space-between;
      padding: 8px 16px; z-index: 100;
    }
    .header-title { font-size: 15px; font-weight: 700; color: #38bdf8; display: flex; align-items: center; gap: 8px; }
    .header-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
    button:disabled { opacity: 0.55; cursor: default; }
    
    select, button {
      background: #1e293b; color: #f8fafc; border: 1px solid #475569;
      padding: 6px 11px; border-radius: 6px; font-size: 12.5px; font-weight: 500;
      cursor: pointer; transition: all 0.2s ease;
    }
    select:hover, button:hover { background: #334155; border-color: #38bdf8; }
    button.btn-primary { background: #0284c7; border-color: #38bdf8; }
    button.btn-primary:hover { background: #0369a1; }
    button.active { background: #0ea5e9; border-color: #7dd3fc; color: #ffffff; box-shadow: 0 0 12px rgba(14, 165, 233, 0.4); }

    #main-container { flex: 1; min-height: 0; position: relative; width: 100%; }
    #canvas-container { width: 100%; height: 100%; position: absolute; left: 0; top: 0; }
    #current-step-banner {
      position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 8; pointer-events: none;
      display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px;
      width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 12px 24px;
      border: 1px solid rgba(56,189,248,.55); border-radius: 10px;
      background: rgba(11,17,30,.9); box-shadow: 0 4px 20px rgba(0,0,0,.25);
      text-align: center; color: #f8fafc; font-size: clamp(20px,1.7vw,30px); font-weight: 700; line-height: 1.4;
    }
    #current-step-number { color: #38bdf8; white-space: nowrap; }
    #current-step-title { overflow-wrap: anywhere; }
    #view-settings-panel { position: absolute; right: 14px; top: 92px; bottom: 86px; width: 350px; max-width: calc(100% - 28px); height: fit-content; max-height: calc(100% - 178px); overflow-y: auto; z-index: 20; padding: 16px; border: 1px solid #38bdf8; border-radius: 10px; background: rgba(15,23,42,.97); box-shadow: 0 12px 30px #0006; }
    #view-settings-panel[hidden] { display: none; }
    #view-settings-panel .panel-title { align-items: center; color: #f8fafc; font-size: 16px; }
    #view-settings-panel select { width: 100%; white-space: normal; }
    .view-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 8px; font-size: 14px; }
    .view-setting-row input[type=number] { width: 76px; padding: 6px; background: #1e293b; border: 1px solid #475569; border-radius: 5px; color: #f8fafc; }
    .view-setting-row input[type=checkbox] { accent-color: #0ea5e9; }
    .view-setting-actions { display: flex; gap: 8px; margin: 12px 0; }
    .view-setting-note { font-size: 12px; line-height: 1.6; color: #94a3b8; margin-top: 10px; }
    #view-settings-message { color: #7dd3fc; }

    #site-compass { position: absolute; right: 14px; bottom: 76px; width: 140px; height: 118px; pointer-events: none; z-index: 6; background: rgba(15,23,42,0.65); border-radius: 10px; }

    #step-panel {
      position: absolute; top: 14px; left: 14px; width: 320px; max-height: calc(100% - 85px);
      background: rgba(15, 23, 42, 0.92); border: 1px solid #334155; border-radius: 8px;
      backdrop-filter: blur(10px); padding: 12px; display: flex; flex-direction: column;
      z-index: 10; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5);
    }
    .panel-title { font-size: 13px; font-weight: 600; color: #94a3b8; margin-bottom: 8px; display: flex; justify-content: space-between; }
    #step-panel .panel-title { font-size: 15px; font-weight: 700; color: #e2e8f0; margin-bottom: 12px; }
    #step-panel[hidden], #btn-expand-steps[hidden] { display: none; }
    #step-panel .panel-title { align-items: center; gap: 6px; white-space: nowrap; }
    #btn-collapse-steps { padding: 4px 7px; font-size: 12px; }
    #btn-expand-steps { position: absolute; top: 14px; left: 14px; z-index: 10; padding: 10px 14px; background: rgba(15,23,42,.95); border-color: #38bdf8; font-size: 15px; font-weight: 700; }
    .step-list { overflow-y: auto; min-height: 0; flex: 1; padding-right: 4px; display: flex; flex-direction: column; gap: 7px; overscroll-behavior: contain; }
    .step-list::-webkit-scrollbar { width: 4px; }
    .step-list::-webkit-scrollbar-thumb { background: #475569; border-radius: 2px; }
    .step-item {
      padding: 12px; border-radius: 6px; background: #1e293b; border: 1px solid #334155;
      flex-shrink: 0; cursor: pointer; transition: background-color .2s ease, border-color .2s ease;
    }
    .step-item:hover { border-color: #64748b; background: #273549; }
    .step-item.active { background: #075985; border-color: #38bdf8; color: #fff; box-shadow: inset 4px 0 0 #38bdf8, 0 0 10px rgba(14,165,233,0.2); }
    .step-item-title { font-weight: 700; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }

    #param-card {
      position: absolute; top: 14px; right: 14px; width: 310px;
      background: rgba(15, 23, 42, 0.92); border: 1px solid #334155; border-radius: 8px;
      backdrop-filter: blur(10px); padding: 12px; z-index: 10;
      box-shadow: 0 10px 25px -5px rgba(0,0,0,0.5);
    }
    .param-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 6px; }
    .param-table td { padding: 4px 3px; border-bottom: 1px solid #334155; }
    .param-label { color: #94a3b8; width: 34%; }
    .param-val { color: #f1f5f9; font-weight: 500; width: 66%; font-family: "Consolas", monospace; }

    #timeline-bar {
      position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
      background: rgba(15, 23, 42, 0.92); border: 1px solid #334155; border-radius: 8px;
      padding: 8px 18px; display: flex; align-items: center; gap: 12px; z-index: 10;
      box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    }
    .timeline-slider { width: 260px; cursor: pointer; accent-color: #0284c7; }

    #custom-modal-backdrop {
      display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75);
      backdrop-filter: blur(6px); z-index: 1000; justify-content: center; align-items: center;
    }
    #custom-modal-backdrop.show { display: flex; }
    #custom-modal {
      background: #0f172a; border: 1px solid #38bdf8; border-radius: 12px;
      width: 760px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
      padding: 20px 24px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
      color: #e2e8f0; display: flex; flex-direction: column; gap: 16px;
    }
    #custom-modal::-webkit-scrollbar { width: 6px; }
    #custom-modal::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
    .modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; padding-bottom: 10px; }
    .modal-title { font-size: 16px; font-weight: 700; color: #38bdf8; display: flex; align-items: center; gap: 8px; }
    .modal-section { background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 12px 14px; }
    .modal-section-title { font-size: 13px; font-weight: 600; color: #facc15; margin-bottom: 10px; }
    .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; }
    .form-group { display: flex; flex-direction: column; gap: 4px; }
    .form-group label { font-size: 11px; color: #94a3b8; font-weight: 500; }
    .form-group input, .form-group select {
      background: #0b111e; border: 1px solid #475569; color: #f8fafc;
      padding: 6px 8px; border-radius: 5px; font-size: 12px; font-family: "Consolas", monospace;
    }
    .form-group input:focus, .form-group select:focus { border-color: #38bdf8; outline: none; }
    .template-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
    .btn-template { background: #334155; border: 1px solid #64748b; font-size: 11.5px; padding: 4px 10px; border-radius: 5px; }
    .btn-template:hover { background: #475569; border-color: #38bdf8; }
    #custom-toast {
      position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
      background: #0284c7; color: #ffffff; padding: 8px 18px; border-radius: 20px;
      font-size: 12.5px; font-weight: 600; display: none; z-index: 1100;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    }
