*{box-sizing:border-box;margin:0;padding:0}:root{--bg:#0f0f12;--surface:#1a1a20;--text:#e8e8ed;--muted:#8888a0;--accent:#7c3aed}body{font-family:Segoe UI,system-ui,sans-serif;background:var(--bg);color:var(--text);min-height:100vh;line-height:1.5}header{padding:1.5rem 2rem;background:var(--surface);border-bottom:1px solid hsla(0,0%,100%,.06)}.header-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}.header-left{flex-shrink:0}.header-left h1{font-size:1.25rem;font-weight:600;margin:0 0 .25rem;color:var(--text)}.header-subtitle{margin:0;font-size:.875rem;color:var(--muted)}.header-docs-link{color:var(--accent);text-decoration:none}.header-docs-link:hover{text-decoration:underline}.header-center{flex:1 1;display:flex;justify-content:center;min-width:0}.header-right{flex-shrink:0;display:flex;align-items:center;gap:.75rem}.header-buttons{display:flex;gap:.5rem;flex-wrap:wrap}.header-buttons button{padding:.5rem 1.25rem;font-size:.95rem;font-weight:600;border:none;border-radius:8px;cursor:pointer;white-space:nowrap}.header-buttons button:hover{filter:brightness(1.1)}.header-buttons button:active{transform:scale(.98)}.run-btn{color:#fff;background:var(--accent)}.stop-btn{color:#fff;background:#b91c1c}.update-btn{color:#fff;background:#0d9488}.save-btn{color:#fff;background:#059669}.header-user{font-size:.9rem;color:var(--text);white-space:nowrap}.signout-link{padding:0;font-size:.9rem;font-weight:500;border:none;border-radius:0;cursor:pointer;background:none;color:var(--accent);text-decoration:none}.signout-link:hover{text-decoration:underline}.auth-header-btn{padding:.5rem 1rem;font-size:.9rem;font-weight:600;border-radius:8px;text-decoration:none;color:var(--text);background:hsla(0,0%,100%,.1)}.auth-header-btn:hover{background:hsla(0,0%,100%,.15)}.auth-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem}.auth-card{background:var(--surface);border-radius:12px;border:1px solid hsla(0,0%,100%,.1);padding:2rem;width:100%;max-width:360px}.auth-card h1{font-size:1.5rem;margin-bottom:1.5rem}.auth-card label{display:block;margin-bottom:1rem;font-size:.9rem;font-weight:500}.auth-card input{display:block;width:100%;margin-top:.35rem;padding:.5rem .75rem;font-size:.95rem;background:var(--bg);border:1px solid hsla(0,0%,100%,.1);border-radius:6px;color:var(--text)}.auth-card input:focus{outline:none;border-color:var(--accent)}.auth-card button[type=submit]{width:100%;padding:.6rem 1rem;font-size:1rem;font-weight:600;border:none;border-radius:8px;cursor:pointer;background:var(--accent);color:#fff;margin-top:.5rem}.auth-card button[type=submit]:hover:not(:disabled){filter:brightness(1.1)}.auth-card button[type=submit]:disabled{opacity:.6;cursor:not-allowed}.auth-error{color:#b91c1c;font-size:.9rem;margin:.5rem 0}.auth-hint{color:var(--muted);font-size:.85rem;margin:-.5rem 0 .5rem}.auth-link{margin-top:1rem;text-align:center;font-size:.9rem;color:var(--muted)}.auth-link a{color:var(--accent);text-decoration:none}.auth-link a:hover{text-decoration:underline}.auth-inline-link{background:none;border:none;padding:0;font:inherit;color:var(--accent);cursor:pointer;text-decoration:none}.auth-inline-link:hover:not(:disabled){text-decoration:underline}.auth-inline-link:disabled{opacity:.7;cursor:not-allowed}header h1{font-size:1.5rem;font-weight:600;margin-bottom:.25rem}header p{color:var(--muted);font-size:.9rem}header a{color:var(--accent);text-decoration:none}header a:hover{text-decoration:underline}main{padding:1.5rem 2rem;max-width:1200px;margin:0 auto}main>div{display:flex;gap:1rem;align-items:stretch;min-height:500px}.pallet-buttons{display:flex;flex-direction:column;gap:.5rem;flex-shrink:0;min-width:140px}.pallet-buttons button{padding:.5rem 1rem;font-size:.9rem;font-weight:600;border:none;border-radius:8px;cursor:pointer;white-space:nowrap;color:#fff;background:var(--accent)}.pallet-buttons button.clear-btn{background:#b91c1c}.pallet-buttons button.pattern-btn{background:#2563eb}.pallet-buttons button:hover{filter:brightness(1.1)}.pallet-buttons .mode-toggle .mode-toggle-btn,.pallet-buttons .toggle-button .toggle-button-btn{background:var(--surface);color:var(--muted)}.pallet-buttons .mode-toggle .mode-toggle-btn.active,.pallet-buttons .toggle-button .toggle-button-btn.active{background:var(--accent);color:#fff;box-shadow:inset 0 0 0 2px hsla(0,0%,100%,.25);font-weight:700}.pallet-buttons.mode-patterns .mode-toggle .mode-toggle-btn.active,.pallet-buttons.mode-patterns .toggle-button .toggle-button-btn.active{background:#2563eb}.mode-toggle,.toggle-button{display:flex;gap:0;border-radius:8px;overflow:hidden;border:1px solid hsla(0,0%,100%,.2)}.mode-toggle-btn,.toggle-button-btn{flex:1 1;padding:.4rem .75rem;font-size:.85rem;font-weight:600;border:none;cursor:pointer;background:var(--surface);color:var(--muted);transition:background .15s,color .15s}.mode-toggle-btn:first-child,.toggle-button-btn:first-child{border-right:1px solid hsla(0,0%,100%,.2);border-radius:8px 0 0 8px}.mode-toggle-btn:last-child,.toggle-button-btn:last-child{border-radius:0 8px 8px 0}.mode-toggle-btn:hover,.toggle-button-btn:hover{color:var(--text)}.repl-container{flex:1 1;min-width:0;border-radius:12px;overflow:hidden;border:1px solid hsla(0,0%,100%,.08);background:var(--surface);min-height:500px}.repl-container>div{min-height:100%}.repl-container strudel-editor{display:none;width:100%;min-height:500px}.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;z-index:1000}.modal{background:var(--surface);border-radius:12px;border:1px solid hsla(0,0%,100%,.1);max-width:560px;width:90%;max-height:90vh;overflow:auto}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.25rem;border-bottom:1px solid hsla(0,0%,100%,.08)}.modal-header h2{font-size:1.25rem;font-weight:600}.modal-close{background:none;border:none;color:var(--muted);font-size:1.5rem;cursor:pointer;padding:0 .25rem;line-height:1}.modal-close:hover{color:var(--text)}.modal-body{padding:1.25rem}.modal-message{margin-bottom:.5rem}.modal-hint{color:var(--muted)}.modal-hint,.save-form label{font-size:.9rem;margin-bottom:1rem}.save-form label{display:block;font-weight:500}.save-form input,.save-form textarea{display:block;width:100%;margin-top:.35rem;padding:.5rem .75rem;font-size:.95rem;background:var(--bg);border:1px solid hsla(0,0%,100%,.1);border-radius:6px;color:var(--text);font-family:inherit}.save-form textarea{font-family:ui-monospace,monospace;resize:vertical;min-height:120px}.save-form input:focus,.save-form textarea:focus{outline:none;border-color:var(--accent)}.save-form input[readonly]{opacity:.8;cursor:default}.save-error{color:#b91c1c;font-size:.9rem;margin-bottom:1rem}.modal-actions{display:flex;gap:.75rem;margin-top:1rem}.modal-actions button{padding:.5rem 1rem;font-size:.95rem;font-weight:600;border:none;border-radius:8px;cursor:pointer;background:hsla(0,0%,100%,.1);color:var(--text)}.modal-actions button:hover:not(:disabled){background:hsla(0,0%,100%,.15)}.save-as-new-btn,.save-submit-btn{background:var(--accent)!important;color:#fff!important}.modal-actions button:disabled{opacity:.6;cursor:not-allowed}