:root{color-scheme:light;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:#f6f7f8;color:#202124;--border: #d8dee4;--muted: #64707d;--panel: #ffffff;--ink: #202124;--teal: #0f766e;--teal-dark: #115e59;--amber: #b45309;--red: #b42318;--green: #18794e;--blue: #2563eb}*{box-sizing:border-box}body{margin:0;min-width:320px}button,input,textarea,select{font:inherit}.app-shell{min-height:100vh;display:grid;grid-template-columns:248px 1fr}.sidebar{background:#fff;border-right:1px solid var(--border);padding:20px 16px;display:flex;flex-direction:column;gap:20px}.brand{display:flex;align-items:center;gap:12px}.brand strong{display:block;font-size:16px}.brand span{display:block;color:var(--muted);font-size:12px;margin-top:2px}.brand-mark{width:38px;height:38px;border-radius:8px;display:grid;place-items:center;color:#fff;background:#0f766e;font-weight:700}.nav-list{display:grid;gap:6px;flex:1;align-content:start}.nav-list button{display:flex;align-items:center;gap:10px;border:0;border-radius:8px;padding:10px 12px;color:#344054;background:transparent;cursor:pointer;text-align:left}.nav-list button.active,.nav-list button:hover{background:#e8f3f1;color:var(--teal-dark)}.user-menu{position:relative}.user-menu-trigger{width:100%;min-height:46px;border:1px solid var(--border);border-radius:8px;padding:6px 8px;background:#fff;color:var(--ink);display:grid;grid-template-columns:30px minmax(0,1fr) 16px;align-items:center;gap:8px;cursor:pointer;text-align:left}.user-menu-trigger:hover,.user-menu-trigger[aria-expanded=true]{border-color:var(--teal);background:#fbfefd}.user-avatar{width:30px;height:30px;border-radius:8px;display:grid;place-items:center;background:#e8f3f1;color:var(--teal-dark);font-weight:700;font-size:13px}.user-menu-text{min-width:0}.user-menu-text strong,.user-menu-text span{display:block}.user-menu-text strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.user-menu-text span{color:var(--muted);font-size:12px;margin-top:1px}.user-menu-popover{position:absolute;left:0;right:0;bottom:calc(100% + 8px);z-index:10;display:grid;gap:4px;padding:6px;border:1px solid var(--border);border-radius:8px;background:#fff;box-shadow:0 12px 32px #10182824}.user-menu-item{width:100%;border:0;border-radius:6px;padding:9px 10px;background:transparent;color:var(--red);display:flex;align-items:center;gap:8px;cursor:pointer;text-align:left}.user-menu-item:hover{background:#fff1f0}.main{padding:24px;overflow:hidden}.workspace{min-height:calc(100vh - 48px);display:grid;gap:16px}.single-column{grid-template-columns:minmax(0,1fr)}.two-column{grid-template-columns:minmax(320px,.8fr) minmax(420px,1.2fr)}.feedback-workspace{grid-template-columns:minmax(420px,.9fr) minmax(460px,1.1fr)}.protocols-workspace.two-column{grid-template-columns:minmax(360px,.72fr) minmax(620px,1.28fr)}.panel{min-width:0;background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:16px}.section-title,.card-header,.conversation-header,.form-actions,.reply-actions,.header-actions,.compact-row,.filter-actions{display:flex;align-items:center;gap:10px}.section-title,.card-header,.conversation-header{justify-content:space-between}h1,h2,p{margin:0}h1{font-size:20px;line-height:1.3}h2{font-size:15px}.section-title p,.row-meta,.plain-row span,.portal-item span{color:var(--muted);font-size:13px}.btn{min-height:36px;border-radius:8px;border:1px solid transparent;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 13px;cursor:pointer;text-decoration:none;white-space:nowrap}.btn:disabled{opacity:.55;cursor:not-allowed}.btn-default{background:var(--teal);color:#fff}.btn-default:hover{background:var(--teal-dark)}.btn-secondary{background:#f4f6f8;border-color:var(--border);color:var(--ink)}.btn-ghost{background:transparent;color:#475467}.btn-destructive{background:#fff1f0;color:var(--red);border-color:#ffd8d4}.field{display:grid;gap:6px;color:#3b424a;font-size:13px}.input,.textarea{width:100%;border:1px solid var(--border);border-radius:8px;background:#fff;color:var(--ink);padding:9px 10px;outline:none;min-height:38px}.select-input{appearance:none;-webkit-appearance:none;padding-right:42px;background-image:url("data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23202124' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right 14px center;background-size:18px 18px}.textarea{resize:vertical}.input:focus,.textarea:focus{border-color:var(--teal);box-shadow:0 0 0 3px #0f766e24}.badge{display:inline-flex;align-items:center;min-height:24px;padding:0 8px;border-radius:999px;font-size:12px;border:1px solid transparent}.badge-neutral{color:#4b5563;background:#f3f4f6;border-color:#e5e7eb}.badge-green{color:var(--green);background:#ecfdf3;border-color:#bbf7d0}.badge-blue{color:var(--blue);background:#eff6ff;border-color:#bfdbfe}.badge-red{color:var(--red);background:#fff1f0;border-color:#ffd8d4}.badge-amber{color:var(--amber);background:#fffbeb;border-color:#fde68a}.card{border:1px solid var(--border);border-radius:8px;padding:12px;background:#fff}.selected-card{border-color:var(--teal)}.product-card{cursor:pointer;transition:border-color .16s ease,background .16s ease}.product-card:hover{border-color:var(--teal);background:#fbfefd}.product-list,.feedback-list,.protocol-list,.portal-feedback-list{display:grid;gap:10px;margin-top:14px}.plain-row{width:100%;display:flex;justify-content:space-between;gap:12px;border:0;background:transparent;padding:8px 0 0;text-align:left;cursor:pointer}code{word-break:break-all;color:#334155}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid .full{grid-column:1 / -1}.product-form{display:grid;gap:16px}.product-detail-panel .section-title{margin-bottom:16px}.form-section{display:grid;gap:12px;padding:14px;border:1px solid var(--border);border-radius:8px;background:#fff}.form-section h2{font-size:15px;line-height:1.3}.input[readonly],.textarea[readonly]{color:#475569;background:#f8fafc;cursor:default}.input[readonly]:focus,.textarea[readonly]:focus{border-color:var(--border);box-shadow:none}.filters{margin-top:14px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.filter-actions{align-self:end}.feedback-list-panel,.protocol-list-panel{overflow:auto;max-height:calc(100vh - 48px)}.feedback-item,.protocol-item,.portal-item{display:grid;gap:8px;border:1px solid var(--border);border-radius:8px;background:#fff;padding:12px;cursor:pointer;text-align:left}.feedback-item:hover,.feedback-item.active,.protocol-item:hover,.protocol-item.active,.portal-item:hover,.portal-item.active{border-color:var(--teal);background:#fbfefd}.feedback-item>div:first-child,.protocol-item>div:first-child,.portal-item>div:first-child,.row-meta{display:flex;align-items:center;gap:8px;min-width:0}.feedback-item>div:first-child,.protocol-item>div:first-child{justify-content:space-between}.feedback-item strong,.protocol-item strong,.portal-item strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.feedback-item p,.protocol-item p,.portal-item p{color:#475467;font-size:13px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.protocol-tools{margin-top:14px;display:grid;grid-template-columns:minmax(160px,.35fr) minmax(280px,1fr) auto;gap:10px;align-items:end}.protocol-detail-panel{overflow:auto;max-height:calc(100vh - 48px)}.link-row{display:grid;grid-template-columns:76px minmax(0,1fr) auto auto;gap:10px;align-items:center;margin:10px 0 14px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:#f8fafc;font-size:13px}.link-row span{color:var(--muted)}.link-row-url{color:var(--teal-dark);overflow-wrap:anywhere}.link-row .btn{justify-self:end}.protocol-editor-grid{display:grid;grid-template-columns:minmax(300px,.95fr) minmax(320px,1.05fr);gap:14px}.protocol-editor,.protocol-preview-section{align-content:start}.protocol-editor .textarea{min-height:560px;line-height:1.55;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}.markdown-preview{min-height:560px;max-height:72vh;overflow:auto;border:1px solid var(--border);border-radius:8px;padding:18px;background:#fff;color:var(--ink);font-size:15px;line-height:1.7;overflow-wrap:anywhere}.markdown-preview :first-child{margin-top:0}.markdown-preview :last-child{margin-bottom:0}.markdown-preview h1,.markdown-preview h2,.markdown-preview h3{line-height:1.35;margin:1.4em 0 .6em}.markdown-preview h1{font-size:26px}.markdown-preview h2{font-size:21px}.markdown-preview h3{font-size:17px}.markdown-preview p,.markdown-preview ul,.markdown-preview ol,.markdown-preview blockquote,.markdown-preview pre{margin:0 0 1em}.markdown-preview blockquote{border-left:4px solid var(--border);color:#475467;padding-left:12px}.markdown-preview pre{overflow:auto;padding:12px;border-radius:8px;background:#f1f5f9}.markdown-preview code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92em}.markdown-preview a{color:var(--teal-dark)}.conversation-panel,.user-conversation{min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto}.message-list{min-height:0;overflow:auto;padding:16px 4px;display:flex;flex-direction:column;gap:12px;overscroll-behavior:contain}.message-row{max-width:min(720px,92%);display:flex;align-items:flex-start;gap:10px}.message-row.from-admin{align-self:flex-end;flex-direction:row-reverse}.message-row.from-user{align-self:flex-start}.message-avatar{width:34px;height:34px;border-radius:999px;flex:0 0 34px;display:grid;place-items:center;background:#e8f3f1;color:var(--teal-dark);font-size:13px;font-weight:700}.message-row.from-admin .message-avatar{background:var(--teal);color:#fff}.message-content{min-width:0;display:grid;gap:5px}.message-row.from-admin .message-content{justify-items:end}.message-meta{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;line-height:1.35}.message-row.from-admin .message-meta{justify-content:flex-end}.message-bubble{border:1px solid var(--border);border-radius:8px;padding:10px 12px;background:#fff}.message-bubble p{line-height:1.6;margin:0;white-space:pre-wrap;word-break:break-word}.message-row.from-admin .message-bubble{background:#edf7f5;border-color:#b7e1d9}.message-row.from-user .message-bubble{background:#fff}.reply-box,.chat-input{border-top:1px solid var(--border);padding-top:12px}.reply-actions{justify-content:flex-end;margin-top:10px}.chat-input{display:grid;grid-template-columns:1fr auto;gap:10px;background:#f6f7f8;position:sticky;bottom:0;z-index:2}.chat-input-multiline{align-items:end}.chat-input-multiline .textarea{min-height:84px;max-height:180px}.login-screen,.user-shell{min-height:100vh}.login-screen{display:grid;place-items:center;padding:24px}.login-panel{width:min(420px,100%);display:grid;gap:16px;background:#fff;border:1px solid var(--border);border-radius:8px;padding:24px}.login-brand{margin-bottom:8px}.alert,.notice{border-radius:8px;padding:10px 12px;font-size:13px}.alert{color:var(--red);background:#fff1f0;border:1px solid #ffd8d4}.notice{color:var(--green);background:#ecfdf3;border:1px solid #bbf7d0;margin-top:10px}.empty-state{display:grid;place-items:center;min-height:280px;color:var(--muted);border:1px dashed var(--border);border-radius:8px}.user-shell{--portal-background: #f7f8fa;--portal-surface: #ffffff;--portal-primary: var(--teal);--portal-primary-hover: var(--teal-dark);--portal-primary-text: #ffffff;--portal-text: var(--ink);--portal-muted: var(--muted);--portal-border: var(--border);--portal-input-background: #ffffff;--portal-user-bubble: #ffffff;--portal-admin-bubble: #edf7f5;display:grid;grid-template-columns:minmax(320px,760px);justify-content:center;background:var(--portal-background);color:var(--portal-text);font-size:16px}.user-list{background:var(--portal-background);padding:14px;overflow:auto;min-height:100vh}.user-topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.user-topbar span{display:block;color:var(--muted);font-size:12px;margin-top:2px;word-break:break-all}.new-feedback{display:grid;gap:10px;border-bottom:1px solid var(--portal-border);padding-bottom:12px;margin-bottom:12px}.new-feedback-submit{min-height:52px;font-size:15px;font-weight:600}.user-conversation{padding:16px;background:var(--portal-background);height:100dvh;min-height:100dvh;overflow:hidden;padding-bottom:max(16px,env(safe-area-inset-bottom))}.show-list .user-conversation,.show-detail .user-list{display:none}.show-detail{grid-template-columns:minmax(320px,860px);height:100dvh;overflow:hidden}.conversation-title{flex:1;min-width:0;display:grid;gap:10px}.conversation-title h1{line-height:1.25;overflow-wrap:anywhere}.conversation-title .row-meta{flex-wrap:wrap;row-gap:8px}.user-shell .input,.user-shell .textarea{background:var(--portal-input-background);border-color:var(--portal-border);color:var(--portal-text);font-size:16px;padding:10px 12px}.user-shell .input::placeholder,.user-shell .textarea::placeholder{color:var(--portal-muted)}.user-shell .input:focus,.user-shell .textarea:focus{border-color:var(--portal-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--portal-primary),transparent 84%)}.user-shell .btn-default{background:var(--portal-primary);color:var(--portal-primary-text)}.user-shell .btn-default:hover{background:var(--portal-primary-hover)}.user-shell .btn-secondary{background:var(--portal-surface);border-color:var(--portal-border);color:var(--portal-text)}.user-shell .btn-ghost{color:var(--portal-text)}.user-shell .portal-item,.user-shell .message-bubble{background:var(--portal-surface);border-color:var(--portal-border);color:var(--portal-text)}.user-shell .portal-item{padding:14px}.user-shell .portal-item strong{font-size:16px}.user-shell .portal-item p{font-size:14px}.user-shell .conversation-title h1{font-size:22px}.user-shell .badge{min-height:26px;font-size:13px;padding:0 9px}.user-shell .conversation-header{align-items:flex-start;border-bottom:1px solid var(--portal-border);padding-bottom:12px}.user-shell .message-list{gap:14px;padding:16px 0}.user-shell .message-row{max-width:min(720px,94%)}.user-shell .message-bubble{padding:12px 14px}.user-shell .message-meta{color:var(--portal-muted);font-size:13px;line-height:1.45}.user-shell .message-bubble p{font-size:16px;line-height:1.68}.user-shell .chat-input{gap:12px;padding-top:14px}.user-shell .chat-input-multiline{align-items:stretch}.user-shell .chat-input-multiline .textarea{min-height:96px;line-height:1.55}.user-shell .chat-input .btn{min-height:56px;align-self:stretch;padding:0 20px;font-size:16px;font-weight:600}.user-shell .chat-input .btn svg{width:18px;height:18px}.user-shell .portal-item:hover,.user-shell .portal-item.active{border-color:var(--portal-primary);background:var(--portal-surface)}.user-shell .portal-item p,.user-shell .portal-item span,.user-shell .row-meta{color:var(--portal-muted);font-size:13px}.user-shell .conversation-title .row-meta span{overflow-wrap:anywhere}.user-shell .message-row.from-user{align-self:flex-end;flex-direction:row-reverse}.user-shell .message-row.from-user .message-content{justify-items:end}.user-shell .message-row.from-user .message-meta{justify-content:flex-end}.user-shell .message-row.from-user .message-avatar{background:var(--portal-primary);color:var(--portal-primary-text)}.user-shell .message-row.from-user .message-bubble{background:var(--portal-user-bubble);border-color:var(--portal-border)}.user-shell .message-row.from-admin{align-self:flex-start;flex-direction:row}.user-shell .message-row.from-admin .message-content{justify-items:start}.user-shell .message-row.from-admin .message-meta{justify-content:flex-start}.user-shell .message-row.from-admin .message-avatar{background:var(--portal-surface);color:var(--portal-primary);border:1px solid var(--portal-border)}.user-shell .message-row.from-admin .message-bubble{background:var(--portal-admin-bubble);border-color:var(--portal-border)}.user-shell .chat-input{background:var(--portal-background);border-color:var(--portal-border)}.user-shell .empty-state{color:var(--portal-muted);border-color:var(--portal-border)}@media(max-width:1100px){.app-shell{grid-template-columns:84px 1fr}.sidebar{padding:16px 10px}.brand div:not(.brand-mark),.nav-list button span,.sidebar .btn{font-size:0}.user-menu-text,.user-menu-trigger>svg{display:none}.user-menu-trigger{grid-template-columns:30px;justify-content:center}.user-menu-popover{width:156px;left:auto;right:0}.two-column,.protocols-workspace.two-column,.feedback-workspace{grid-template-columns:1fr}.feedback-list-panel,.protocol-list-panel,.protocol-detail-panel{max-height:none}.protocol-editor-grid{grid-template-columns:1fr}}@media(max-width:760px){.main{padding:12px}.app-shell{display:block}.sidebar{min-height:auto;border-right:0;border-bottom:1px solid var(--border);flex-direction:row;align-items:center}.user-menu{margin-left:auto}.user-menu-popover{bottom:auto;top:calc(100% + 8px)}.nav-list{grid-auto-flow:column;flex:1}.form-grid,.filters,.protocol-tools,.chat-input,.link-row{grid-template-columns:1fr}.link-row .btn{justify-self:stretch}.protocol-editor .textarea,.markdown-preview{min-height:360px}.conversation-header,.section-title{align-items:flex-start;flex-direction:column}.user-conversation{padding:14px 12px;padding-bottom:max(14px,env(safe-area-inset-bottom))}.user-shell .conversation-header{flex-direction:row;align-items:center;gap:12px}.user-shell .conversation-title{gap:8px}.user-shell .conversation-title h1{font-size:21px}.user-shell .message-list{gap:12px;padding:14px 0}.user-shell .message-row{max-width:96%;gap:8px}.user-shell .message-avatar{width:32px;height:32px;flex-basis:32px;font-size:12px}.user-shell .message-bubble{padding:12px 13px}.user-shell .message-bubble p{font-size:16px}.user-shell .chat-input{gap:10px;padding-top:12px}.user-shell .chat-input-multiline .textarea{min-height:104px;font-size:17px}.user-shell .chat-input .btn{width:100%;min-height:54px;font-size:17px}.header-actions,.filter-actions,.reply-actions{width:100%;justify-content:stretch}.header-actions .btn,.filter-actions .btn,.reply-actions .btn{flex:1}}
