:root{--bg: #f6f8fa;--surface: #ffffff;--surface-subtle: #f1f4f8;--border: #d0d7de;--accent: #0969da;--accent-border: #54aeff;--accent-soft: #ddf4ff;--success: #1f883d;--success-hover: #1a7f37;--success-active: #166830;--success-border: #2c974b;--success-shadow: 0 10px 20px rgba(46, 164, 79, .25);--text: #1f2328;--muted: #57606a;--radius: 12px;--shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 8px 24px rgba(15, 23, 42, .06);--shadow-soft: 0 12px 36px rgba(15, 23, 42, .12);--topbar-height: 64px;--font: 16px/1.55 "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;--code-font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{margin:0;background:var(--bg);color:var(--text);font:var(--font);-webkit-font-smoothing:antialiased}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}button,input,select,textarea{font:inherit;color:inherit}.app-shell{min-height:100%;background:var(--bg);display:flex;flex-direction:column}.topbar{position:sticky;top:0;z-index:40;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px clamp(16px,4vw,32px);background:var(--surface);border-bottom:1px solid var(--border);box-shadow:0 1px #0f172a0f;min-height:var(--topbar-height);height:var(--topbar-height);box-sizing:border-box;flex-wrap:nowrap}.topbar-left{display:flex;align-items:center;gap:10px;min-width:0;flex:0 0 auto}.brand{font-size:20px;font-weight:600;letter-spacing:-.01em}.brand-button{border:none;background:transparent;padding:0;color:inherit;cursor:pointer;display:inline-flex;align-items:center}.brand-button:focus-visible{outline:2px solid var(--accent-border);outline-offset:3px}.repo-btn{gap:6px;max-width:clamp(180px,42vw,360px);min-width:160px;overflow:hidden;justify-content:flex-start;height:40px;padding:0 12px;display:inline-flex;align-items:center}.repo-btn svg{flex-shrink:0}.repo-label{display:inline-flex;align-items:baseline;gap:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;flex:1 1 auto;font-size:1rem;font-weight:600}.repo-label span:last-child{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}.repo-owner{color:var(--muted);flex-shrink:0;font-weight:500}.topbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:nowrap;min-width:0;flex:1 1 auto}.home-main{max-width:960px;margin:40px auto;padding:0 clamp(16px,4vw,32px);display:flex;flex-direction:column;gap:24px}.home-header{display:flex;flex-direction:column;align-items:flex-start;gap:12px}.home-header h1{margin:0 0 4px;font-size:1.5rem}.home-header p{margin:0;color:var(--muted)}.home-recents{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:10px}.home-repo{width:100%;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:14px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;font-size:1rem;font-weight:500;transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}.home-repo:hover{border-color:var(--accent-border);box-shadow:var(--shadow)}.home-repo:focus-visible{outline:2px solid var(--accent-border);outline-offset:3px}.home-repo-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.home-repo-arrow{color:var(--muted);display:inline-flex}.home-empty{border:1px dashed var(--border);border-radius:var(--radius);padding:32px;text-align:center;color:var(--muted);display:flex;flex-direction:column;gap:12px;align-items:center}.home-empty h2{margin:0;color:var(--text)}.home-empty p{margin:0 0 8px}.toolbar{display:flex;align-items:center;gap:8px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 14px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);color:var(--text);font-size:.95rem;font-weight:500;line-height:1;cursor:pointer;transition:background .18s ease,border-color .18s ease,box-shadow .18s ease,color .18s ease;text-decoration:none}.btn:hover{border-color:var(--accent-border);box-shadow:var(--shadow)}.btn:focus-visible{outline:2px solid var(--accent-border);outline-offset:3px}.btn:disabled{cursor:not-allowed;opacity:.6;box-shadow:none}.btn.primary{background:var(--success);border-color:var(--success-border);color:#fff;box-shadow:var(--success-shadow)}.btn.primary:hover{background:var(--success-hover);border-color:var(--success-hover);box-shadow:0 12px 28px #2ea44f47}.btn.primary:active{background:var(--success-active);border-color:var(--success-active);box-shadow:none}.btn.primary:disabled{background:#1f883d80;border-color:#1f883d66;box-shadow:none}.btn.secondary{color:var(--accent)}.btn.secondary:hover{background:#0969da1a}.sync-btn{width:40px;height:40px;padding:0;border-radius:50%;display:flex;align-items:center;justify-content:center;border-color:transparent;background:transparent}.sync-btn:hover{background:#0969da1a}.sync-btn svg{pointer-events:none}.sync-btn.is-syncing{background:#0969da1f;border-color:transparent}.sync-icon{display:block}.sync-icon.spinning{animation:spin .8s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.btn.ghost{background:transparent;border-color:transparent}.btn.ghost:hover{background:#0969da1a;box-shadow:none}.btn.subtle{background:#0f172a0d;border-color:transparent}.btn.subtle:hover{border-color:#0f172a26;box-shadow:none}.btn.subtle.danger,.btn.danger{color:#cf222e}.btn.subtle.danger:hover,.btn.danger:hover{background:#cf222e1f;border-color:#cf222e33;box-shadow:none}.btn.small{padding:6px 10px;border-radius:8px;font-size:.85rem}.btn.full-width{width:100%}.btn.icon{width:40px;height:40px;border-radius:50%;padding:0;box-shadow:none;background:transparent;border-color:transparent}.btn.icon:hover{background:#0969da1f;border-color:transparent}.account-btn{width:40px;height:40px;padding:0;border-radius:50%;box-shadow:none;display:flex;align-items:center;justify-content:center}.account-btn img,.account-avatar-fallback{width:32px;height:32px;border-radius:50%;border:1px solid var(--border);display:flex;align-items:center;justify-content:center;background:var(--surface-subtle);font-weight:600;color:var(--accent)}.account-btn img{object-fit:cover;background:transparent}.account-avatar-fallback{font-size:.9rem}.input,.select{width:100%;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:10px 12px;transition:border-color .18s ease,box-shadow .18s ease}.input:focus-visible,.select:focus-visible,textarea:focus-visible{outline:none;border-color:var(--accent-border);box-shadow:0 0 0 4px #54aeff59}.app-layout{flex:1;display:grid;grid-template-columns:320px 1fr;background:var(--bg);min-height:0}.app-layout.single{grid-template-columns:1fr}.sidebar{background:var(--surface);border-right:1px solid var(--border);padding:20px 18px;display:flex;flex-direction:column;gap:16px;min-height:0;overflow-y:auto;transform:translate(0);transition:transform .25s ease}.sidebar-header{position:sticky;top:0;display:flex;flex-direction:column;gap:12px;padding-bottom:16px;background:var(--surface);border-bottom:1px solid rgba(208,215,222,.6);z-index:1}.sidebar-title{display:flex;align-items:center;gap:12px;justify-content:space-between;color:var(--muted);font-weight:600;text-transform:uppercase;letter-spacing:.06em;font-size:.8rem}.note-count{background:#0f172a12;border-radius:999px;padding:2px 10px;font-size:.75rem;color:var(--muted)}.note-list{display:flex;flex-direction:column;gap:12px;padding-bottom:24px}.note-item{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:14px;transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease,background .2s ease;cursor:pointer}.note-item:hover{border-color:var(--accent-border);box-shadow:var(--shadow);transform:translateY(-1px)}.note-item.active{border-color:var(--accent-border);background:var(--accent-soft);box-shadow:0 0 0 2px #54aeff40}.note-item-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.note-item-text{display:flex;flex-direction:column;gap:6px;min-width:0}.note-item-title{font-weight:600;word-break:break-word}.note-item-meta{font-size:.78rem;color:var(--muted)}.note-item-actions{display:flex;gap:6px;flex-shrink:0}.note-item-edit{display:flex;flex-direction:column;gap:12px}.note-item-edit-actions{display:flex;gap:8px;justify-content:flex-end}.workspace{display:flex;flex-direction:column;min-height:0;background:var(--bg)}.workspace-body{flex:1;overflow-y:auto;padding:32px clamp(20px,6vw,56px)}.workspace-panels{display:flex;gap:28px;align-items:stretch;min-height:0}.workspace-panels textarea,.workspace-panels .preview{flex:1;min-height:420px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:18px;box-shadow:var(--shadow)}.workspace-panels textarea{resize:vertical;font:var(--code-font)}.workspace-panels .preview{overflow:auto;line-height:1.68;color:var(--text)}.workspace-panels .preview h1,.workspace-panels .preview h2,.workspace-panels .preview h3,.workspace-panels .preview h4{margin-top:1.5em;margin-bottom:.75em;line-height:1.25}.workspace-panels .preview h1{font-size:2rem}.workspace-panels .preview h2{font-size:1.6rem}.workspace-panels .preview h3{font-size:1.3rem}.workspace-panels .preview p{margin:0 0 1em}.workspace-panels .preview pre{background:var(--surface-subtle);border-radius:10px;padding:12px;border:1px solid var(--border);overflow:auto}.workspace-panels .preview code{font:var(--code-font)}.workspace-panels .preview blockquote{border-left:4px solid var(--accent-border);margin:0 0 1em;padding:.2em 1em;background:#0969da14;border-radius:0 8px 8px 0}.empty-state{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:40px clamp(20px,6vw,44px);box-shadow:var(--shadow-soft);max-width:640px;margin:48px auto;text-align:left}.empty-state h2{margin:0 0 12px;font-size:1.6rem}.empty-state p{margin:0 0 12px;color:var(--muted)}.empty-state-status{margin-top:16px;font-weight:600;color:var(--accent)}.status-banner{margin:0 clamp(20px,6vw,56px) 32px;display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--accent-soft);border:1px solid var(--accent-border);border-radius:var(--radius);padding:12px 16px;color:var(--accent);font-weight:500}.repo-switcher-panel{position:fixed;top:var(--topbar-height);left:clamp(20px,6vw,56px);width:min(560px,calc(100vw - (2*clamp(20px,6vw,56px))));background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-soft);padding:12px;z-index:60}.repo-switcher-input-row{display:flex;gap:8px}.repo-switcher-input{flex:1 1 auto}.repo-switcher-status{color:var(--muted);font-size:.9rem;margin:8px 2px 6px}.repo-switcher-list{list-style:none;margin:0;padding:4px 0 0;display:flex;flex-direction:column;gap:4px;max-height:50vh;overflow:auto}.repo-switcher-item{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:10px;border:1px solid transparent;background:transparent;cursor:pointer}.repo-switcher-item:hover,.repo-switcher-item.active{background:var(--surface-subtle);border-color:var(--border)}.repo-switcher-slug{font-weight:600;overflow:hidden;text-overflow:ellipsis}.repo-switcher-connected{color:var(--muted);font-size:.85rem}@media (min-width: 960px){.repo-switcher-panel{left:calc(321px + clamp(20px,6vw,56px));width:min(560px,calc(100vw - (321px + clamp(20px,6vw,56px)) - clamp(20px,6vw,56px)))}.align-workspace{position:absolute;left:calc(321px + clamp(20px,6vw,56px));top:calc((var(--topbar-height) - 40px) / 2);margin-left:0}}.status-banner span:first-of-type{font-size:.75rem;text-transform:uppercase;letter-spacing:.08em}.account-menu{position:fixed;top:calc(var(--topbar-height) + 12px);right:16px;width:min(320px,calc(100vw - 32px));background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow-soft);display:flex;flex-direction:column;gap:12px;z-index:50}.account-menu-header{display:flex;gap:12px;align-items:center}.account-menu-avatar{width:48px;height:48px;border-radius:50%;border:1px solid var(--border);background:var(--surface-subtle);display:flex;align-items:center;justify-content:center;overflow:hidden}.account-menu-avatar img{width:100%;height:100%;object-fit:cover}.account-menu-avatar span{font-size:1.25rem;font-weight:600;color:var(--accent)}.account-name{font-weight:600;word-break:break-word}.account-handle{font-size:.85rem;color:var(--muted);word-break:break-word}.toast{position:fixed;bottom:24px;right:24px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 16px;box-shadow:var(--shadow-soft);display:flex;align-items:center;gap:12px;z-index:40}.sidebar-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a73;z-index:35}.only-mobile{display:none}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f172a73;display:flex;align-items:center;justify-content:center;z-index:60}.modal{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:24px;display:flex;flex-direction:column;gap:16px;width:min(520px,calc(100vw - 40px));box-shadow:var(--shadow-soft)}@media (max-width: 1200px){.workspace-panels{flex-direction:column}.workspace-panels textarea,.workspace-panels .preview{min-height:320px}}@media (max-width: 960px){.app-layout{grid-template-columns:1fr}.sidebar{position:fixed;top:var(--topbar-height);bottom:0;left:0;width:min(320px,88vw);transform:translate(-100%);box-shadow:var(--shadow-soft);z-index:45}.sidebar.open{transform:translate(0)}.workspace{min-height:calc(100vh - var(--topbar-height))}.only-mobile{display:inline-flex}}@media (max-width: 720px){.workspace-body{padding:24px 18px}.status-banner{margin:8px 18px 24px;flex-direction:column;align-items:flex-start}.toast{left:18px;right:18px;bottom:18px}}@media (max-width: 640px){.topbar{padding:10px 16px}.brand-button{display:none}.topbar-left{gap:6px}.home-main{margin:24px auto;gap:18px;padding:0 18px}.home-header{grid-template-columns:1fr;align-items:flex-start}.topbar-actions{gap:8px;flex:1 1 auto}.repo-btn{max-width:52vw}.topbar-actions .repo-btn{order:-1;margin-right:auto}}@media (min-width: 1100px){.repo-btn{max-width:560px}}@media (min-width: 1500px){.repo-btn{max-width:720px}}@media (min-width: 720px) and (max-width: 1099.98px){.repo-btn{max-width:min(48vw,460px);min-width:240px}}@media (max-width: 520px){.repo-btn .repo-owner{display:none}.repo-btn{max-width:60vw}}@media (max-width: 640px){.modal-backdrop{align-items:stretch;justify-content:stretch}.modal{border-radius:0;width:100vw;height:100vh;padding:20px}}@media (max-width: 480px){.topbar{padding:10px 16px}.brand{font-size:18px}.btn{font-size:.9rem}}
