:root{--font-bump: 0px;--btn-height: 36px;--bg-app: #ffffff;--bg-sidebar: #f8fafc;--border: #e5e7eb;--text-main: #111827;--text-muted: #6b7280;--primary: #2563eb;--primary-hover: #1d4ed8;--danger: #dc2626;--danger-hover: #b91c1c}@media(max-width:768px){:root{--font-bump: 2px;--btn-height: 42px}}*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;color:var(--text-main);background:#fff}.install-screen{width:min(560px,calc(100% - 32px));margin:32px auto}.app-shell{position:fixed;inset:0;display:flex;background:var(--bg-app)}.sidebar-overlay{position:fixed;inset:0;background:#0f172a73;opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:40}.modal-overlay{position:fixed;inset:0;background:#0f172a73;z-index:60}.modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:20px;z-index:70}.modal.is-hidden,.modal-overlay.is-hidden{display:none}.modal__card{width:min(440px,100%);background:#fff;border-radius:18px;border:1px solid var(--border);box-shadow:0 24px 60px #0f172a2e;padding:24px}.modal__title{margin:0;font-size:calc(20px + var(--font-bump))}.modal__text{margin:10px 0 0;color:var(--text-muted);font-size:calc(14px + var(--font-bump));line-height:1.5}.modal__actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}.modal__actions .btn{min-width:112px}.sidebar{width:240px;background:var(--bg-sidebar);border-right:1px solid var(--border);display:flex;flex-direction:column;padding:16px 14px;height:100%}.menu{display:flex;flex-direction:column;gap:4px;margin-top:8px}.menu-item{display:flex;align-items:center;gap:10px;padding:0 10px;border-radius:10px;color:#374151;text-decoration:none;font-size:calc(14px + var(--font-bump));height:var(--btn-height);min-height:var(--btn-height)}.menu-item:hover{background:#eef2ff;color:#1f2937}.menu-item.active{background:#e0e7ff;color:#1d4ed8;font-weight:600}.menu-icon{width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;color:#6b7280}.menu-item.active .menu-icon,.menu-item:hover .menu-icon{color:inherit}.footer-menu{position:relative;margin-top:auto;padding-top:16px}.footer-toggle{width:100%;display:flex;align-items:center;gap:10px;padding:10px;border-radius:12px;background:#fff;border:1px solid var(--border);cursor:pointer;font-family:inherit}.footer-logo{width:32px;height:32px;object-fit:contain;border-radius:0}.footer-title{font-size:calc(13px + var(--font-bump));font-weight:600}.footer-toggle-icon{margin-left:auto;color:#6b7280}.footer-dropdown{position:absolute;left:0;right:0;bottom:calc(100% + 10px);background:#fff;border-radius:14px;border:1px solid #e5e7eb;box-shadow:0 16px 30px #0f172a1f;overflow:hidden;display:none;z-index:5}.footer-menu.is-open .footer-dropdown{display:block}.footer-link{display:flex;align-items:center;gap:10px;padding:12px 14px;color:#111827;font-size:calc(14px + var(--font-bump));text-decoration:none}.footer-link+.footer-link{border-top:1px solid #f1f5f9}.footer-link:hover{background:#f8fafc}.footer-icon{width:20px;height:20px;color:#111827;display:inline-flex;align-items:center;justify-content:center}.main{flex:1;overflow-y:auto;padding:20px}.top-bar{display:flex;align-items:center;gap:12px;margin-bottom:16px}.page-title{margin:0;font-size:calc(24px + var(--font-bump))}.page-subtitle{margin:6px 0 0;color:var(--text-muted);font-size:calc(14px + var(--font-bump))}.hamburger{display:none;align-items:center;justify-content:center;width:48px;height:48px;border-radius:10px;border:1px solid var(--border);background:#fff;cursor:pointer;color:#111827}.hamburger svg{width:24px;height:24px;stroke:currentColor;stroke-width:2.4}.page-divider{border-top:1px solid var(--border);margin:12px 0 18px}.section{margin-bottom:24px;border:1px solid var(--border);border-radius:14px;background:#fff;padding:16px}.app-page{display:none}.app-page.is-active{display:block}.section h2{margin:0 0 8px;font-size:calc(18px + var(--font-bump))}.section-subheading{margin:4px 0 10px;font-size:calc(14px + var(--font-bump));font-weight:600;color:#111827}.section p{margin:0 0 14px;color:var(--text-muted);font-size:calc(14px + var(--font-bump));line-height:1.45}.loading-state{display:flex;align-items:center;gap:10px;min-height:40px;padding:10px 12px;border:1px solid #dbeafe;border-radius:12px;background:#eff6ff;color:#1d4ed8;font-size:calc(13px + var(--font-bump))}.loading-state__spinner{width:16px;height:16px;border-radius:50%;border:2px solid #bfdbfe;border-top-color:#2563eb;animation:loading-spin .8s linear infinite;flex:0 0 auto}@keyframes loading-spin{to{transform:rotate(360deg)}}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(240px,1fr));gap:10px 12px}.field{display:flex;flex-direction:column;gap:6px;min-width:0}.field-wide{grid-column:1 / -1}.form{display:grid;gap:12px}.export-mode-panel{display:none}.export-mode-panel.is-active{display:grid;margin-bottom:2px}label{font-size:calc(13px + var(--font-bump));color:#374151}input,select,button{font:inherit}input,select,textarea{min-height:var(--btn-height);border:1px solid #d1d5db;border-radius:8px;padding:0 10px;font-family:inherit;font-size:calc(14px + var(--font-bump));width:100%;color:#111827;background-color:#fff}textarea{padding:10px;resize:vertical}input:focus,select:focus,textarea:focus{outline:none;border-color:#2563eb}select{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding-right:30px;background-image:linear-gradient(45deg,transparent 50%,#6b7280 50%),linear-gradient(135deg,#6b7280 50%,transparent 50%);background-position:calc(100% - 16px) 50%,calc(100% - 11px) 50%;background-size:5px 5px,5px 5px;background-repeat:no-repeat}.demo-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}.export-actions{align-items:center}.section-gap-sm{margin-bottom:12px}.delete-btn{border:none;background:#fee2e2;color:#991b1b;border-radius:6px;width:var(--btn-height);height:var(--btn-height);padding:0;cursor:pointer;font-size:calc(16px + var(--font-bump));line-height:1;display:inline-flex;align-items:center;justify-content:center}.delete-btn:hover{background:#fecaca}.btn{min-height:var(--btn-height);padding:0 18px;border-radius:8px;border:1px solid transparent;font-size:calc(14px + var(--font-bump));cursor:pointer;line-height:1.1;display:inline-flex;align-items:center;justify-content:center}.btn-primary{color:#fff;background:var(--primary)}.btn-secondary{color:#374151;background:#fff;border-color:#d1d5db}.btn-secondary:hover:not(:disabled){border-color:#9ca3af;color:#111827}.btn-primary:hover:not(:disabled){background:var(--primary-hover)}.btn-danger{color:#fff;background:var(--danger)}.btn-danger:hover:not(:disabled){background:var(--danger-hover)}.btn:disabled{opacity:.7;cursor:wait}.tabs-demo{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}.tabs-demo .tab-button{min-width:112px}.tab-button{border:1px solid #d1d5db;background:#fff;color:#374151;font-size:calc(13px + var(--font-bump));padding:0 18px;border-radius:999px;min-height:var(--btn-height);line-height:1.1;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.tab-button.is-active{background:#e0e7ff;border-color:#c7d2fe;color:#1d4ed8;font-weight:600}.tab-panel-demo{border:1px solid #e5e7eb;border-radius:12px;padding:12px;font-size:calc(13px + var(--font-bump));color:#374151;background:#f8fafc}.status-summary p{margin-bottom:8px}.status-summary p:last-child{margin-bottom:0}.badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;min-height:30px;padding:0 14px;font-size:calc(14px + var(--font-bump));font-weight:400;border:1.5px solid transparent;box-sizing:border-box;line-height:1}.badge-success{background:#dcfce7;color:#166534;border-color:#86efac}.badge-danger{background:#fee2e2;color:#991b1b;border-color:#fca5a5}.badge-info{background:#dbeafe;color:#1d4ed8;border-color:#93c5fd}.alert{border-radius:10px;padding:10px 12px;font-size:calc(13px + var(--font-bump));line-height:1.45}.alert-info{background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8}.alert-warning{background:#fffbeb;border:1px solid #fde68a;color:#92400e}.entity-list,.history-list{display:grid;gap:12px}.entity-group{border:1px solid var(--border);border-radius:14px;background:#fff;overflow:hidden}.entity-group__summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;cursor:pointer;font-size:calc(14px + var(--font-bump));font-weight:600}.entity-group__summary::-webkit-details-marker,.entity-card__summary::-webkit-details-marker{display:none}.entity-group__title{color:#111827}.entity-group__count{color:var(--text-muted);font-weight:500}.entity-group__list{display:grid;gap:12px;padding:0 16px 16px}.entity-card{display:block;border:1px solid var(--border);border-radius:14px;background:#fff;overflow:hidden}.entity-card--compact{border-radius:12px}.entity-card__summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px;cursor:pointer}.entity-card__main{min-width:0}.entity-card__title{font-size:calc(14px + var(--font-bump));font-weight:600;color:#111827}.entity-card__meta{margin-top:4px;font-size:calc(13px + var(--font-bump));color:var(--text-muted);line-height:1.4}.entity-card__actions{flex:0 0 auto;display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}.entity-card__body{padding:0 16px 16px}.entity-card__body-actions{margin-top:12px;justify-content:flex-start}.entity-card__open-button{min-width:104px}.entity-card__export-button{min-width:220px}.entity-results{display:grid;gap:18px}.entity-results__section{display:grid;gap:12px}.entity-results__header{display:flex;align-items:center;justify-content:space-between;gap:12px}.entity-results__title{font-size:calc(14px + var(--font-bump));font-weight:600;color:#111827}.entity-results__list,.entity-results__chat-list{display:grid;gap:10px}.session-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.session-toggle{display:inline-flex;align-items:center;gap:8px;min-height:var(--btn-height);padding:0 4px;font-size:calc(13px + var(--font-bump));color:#374151;cursor:pointer;-webkit-user-select:none;user-select:none}.session-toggle input{width:16px;height:16px;min-height:16px;margin:0;accent-color:var(--primary);flex:0 0 auto}.session-list{display:grid;gap:10px}.session-card{display:flex;align-items:flex-start;gap:12px;padding:12px 14px;border:1px solid var(--border);border-radius:14px;background:#fff;cursor:pointer}.session-card.is-selected{border-color:#93c5fd;background:#eff6ff}.session-card__checkbox{width:18px;height:18px;margin-top:2px;accent-color:var(--primary);flex:0 0 auto}.session-card__body{min-width:0;display:grid;gap:4px}.session-card__title{font-size:calc(14px + var(--font-bump));font-weight:600;color:#111827}.session-card__meta{font-size:calc(13px + var(--font-bump));color:var(--text-muted);line-height:1.4}.session-card__chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}.session-card__chip{display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border-radius:999px;border:1px solid #dbeafe;background:#eff6ff;color:#1d4ed8;font-size:calc(12px + var(--font-bump))}.history-card{border-color:var(--border)}.history-card__body{display:grid;gap:10px}.history-card__grid{display:grid;gap:8px}.history-card__row{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:calc(13px + var(--font-bump));color:#374151}.history-card__row span{color:var(--text-muted)}.history-card__row strong{font-weight:600;color:#111827;text-align:right}.entity-chat-list{display:grid;gap:10px}.entity-chat-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:#fff}.entity-chat-item__main{min-width:0}.entity-chat-item__title{font-size:calc(13px + var(--font-bump));font-weight:600;color:#111827}.entity-chat-item__meta{margin-top:3px;font-size:calc(12px + var(--font-bump));color:var(--text-muted);line-height:1.4}.export-progress-text{font-size:calc(13px + var(--font-bump));color:var(--text-muted);line-height:1.4}.entity-chat-item__actions{flex:0 0 auto}.entity-chat-item__sources{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.entity-chat-item__source-chip{display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border-radius:999px;background:#eef2ff;border:1px solid #c7d2fe;color:#1d4ed8;font-size:calc(12px + var(--font-bump));white-space:nowrap}pre.tab-panel-demo{min-height:220px;max-height:360px;margin:0;overflow:auto;white-space:pre-wrap;font:13px/1.6 SFMono-Regular,ui-monospace,monospace}.muted{color:var(--text-muted)}.is-hidden{display:none}.is-hidden-accessible{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}code{padding:2px 6px;border-radius:999px;background:#eff6ff;color:#1d4ed8}@media(max-width:960px){.field-grid{grid-template-columns:1fr}}@media(max-width:768px){.sidebar{position:fixed;left:0;top:0;bottom:0;transform:translate(-100%);transition:transform .2s ease;z-index:50}body.sidebar-open .sidebar{transform:translate(0)}body.sidebar-open .sidebar-overlay{opacity:1;pointer-events:auto}.hamburger{display:inline-flex}.top-bar{align-items:flex-start}.main{padding:16px}.entity-card{display:block}.entity-results__header{align-items:flex-start;flex-direction:column}.entity-card__actions{width:100%;justify-content:flex-start}.entity-card__actions .btn{width:100%}.entity-card__export-button{width:100%;min-width:0}.session-toolbar{align-items:stretch}.session-toolbar .btn{width:100%}.session-toggle{width:100%;justify-content:flex-start;min-height:32px}.session-card{align-items:flex-start;flex-direction:column}.session-card__checkbox{margin-top:0}.session-card__chips{width:100%}.entity-card__summary,.entity-chat-item{align-items:flex-start;flex-direction:column}.entity-chat-item__actions{width:100%}}
