:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;color:#222;background:#f5f5f5;font-size:14px;font-synthesis:none;--yellow:#ffe60f;--line:#f0f0f0;--muted:#999}
*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button{cursor:pointer;border:0;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.45;cursor:wait}input,textarea{font-size:16px}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #d9b800;outline-offset:3px}[hidden]{display:none!important}
button.primary{background:var(--yellow);color:#222;border-radius:22px;padding:12px 20px;font-weight:650}button.quiet{background:transparent;color:#666;padding:8px;border-radius:8px;white-space:nowrap}button.quiet:hover{background:#f2f2f2}
.eyebrow{font-size:10px;letter-spacing:1.5px;font-weight:650;color:#888;margin:0 0 10px}.muted{color:#888;line-height:1.8}.login-screen{min-height:100dvh;display:grid;place-items:center;padding:24px;background:linear-gradient(160deg,#fff8a5 0,#fff 48%)}.login-card{width:min(100%,390px)}.brand-mark{display:grid;place-items:center;background:var(--yellow);color:#222;border-radius:18px;width:44px;height:44px;font-size:28px;font-weight:700;margin-bottom:26px}.login-card h1{font-size:36px;line-height:1.4;letter-spacing:-1px;margin:16px 0}.login-card label{display:block;margin-top:32px;font-size:12px;font-weight:600}.login-card input{display:block;width:100%;padding:16px;border:1px solid #eee;border-radius:14px;margin:10px 0 16px;background:#f7f7f7}.login-card .primary{width:100%;display:flex;justify-content:space-between}.login-foot{font-size:12px;color:#aaa;margin-top:28px}.error{color:#e94d42;min-height:20px}
.workspace{display:grid;grid-template-columns:350px 1fr;height:100dvh;max-width:1600px;margin:auto;background:#fff}.inbox{display:flex;flex-direction:column;border-right:1px solid var(--line);min-height:0}.search-wrap{padding:12px 18px}.search-wrap input{width:100%;height:38px;padding:9px 16px;background:#f5f5f5;border:0;border-radius:22px;font-size:14px}.search-wrap input::placeholder{color:#aaa}.tabs{display:flex;padding:0 18px;gap:26px;border-bottom:1px solid var(--line);flex-shrink:0}.tabs button{position:relative;padding:8px 0 14px;background:none;color:#999;font-size:15px;white-space:nowrap}.tabs button.active{color:#222;font-weight:700}.tabs button.active::after{content:"";position:absolute;bottom:5px;left:50%;width:24px;height:4px;transform:translateX(-50%);border-radius:4px;background:var(--yellow)}.tabs span{margin-left:3px;font-size:11px;font-weight:400;color:#999}
.session-list{overflow:auto;flex:1;padding:0;overscroll-behavior:contain}.session{position:relative;display:flex;gap:12px;text-align:left;width:100%;padding:15px 18px;border-radius:0;background:#fff;align-items:center;margin:0;min-height:84px}.session::after{content:"";position:absolute;bottom:0;left:82px;right:18px;height:1px;background:#f6f6f6}.session.selected{background:#fffced}.avatar{flex:0 0 50px;height:50px;border-radius:14px;background:#fff1bd;display:grid;place-items:center;color:#a98121;font-size:21px;font-weight:600}.session:nth-child(3n+2) .avatar{background:#e6edf9;color:#6886b5}.session:nth-child(3n) .avatar{background:#f9e8de;color:#ba8b6e}.session-body{flex:1;min-width:0}.session-top{display:flex;justify-content:space-between;align-items:center;gap:8px}.session-top strong{font-size:15px;font-weight:600;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.session time{font-size:11px;color:#aaa;white-space:nowrap}.snippet{display:block;min-width:0;font-size:13px;color:#999;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:8px}.session-bottom{display:flex;gap:8px;align-items:center;justify-content:space-between}.human-pill{flex-shrink:0;font-size:10px;color:#9c7c27;background:#fff7d7;border-radius:4px;padding:2px 5px;margin-top:7px;white-space:nowrap}.unread{position:absolute;top:10px;left:54px;min-width:18px;height:18px;line-height:18px;padding:0 5px;background:#ff4d4f;color:#fff;border-radius:10px;font-size:10px;text-align:center;box-shadow:0 0 0 2px #fff}
.chat{min-width:0;min-height:0;background:#f5f5f5}.no-session{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#aaa}.no-session h2{font-size:18px;font-weight:500;color:#666}.no-session p{font-size:12px}.empty-mark{font-size:60px;color:#e0c844}.conversation{height:100%;display:flex;flex-direction:column}.chat-head{flex-shrink:0;background:#fff;display:flex;align-items:center;gap:12px;padding:14px 22px;border-bottom:1px solid var(--line)}.chat-heading{flex:1;min-width:0}.chat-heading h2{font-size:17px;font-weight:650;margin:0}.chat-heading p{font-size:11px;color:#999;margin:5px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.back{display:none;background:transparent;font-size:34px;color:#222;padding:0 6px;line-height:1}.chat-head .quiet{font-size:12px;border:1px solid #e8e8e8;border-radius:18px;padding:7px 11px}.chat-notice{flex-shrink:0;display:flex;align-items:center;justify-content:space-between;padding:5px 22px;font-size:11px;color:#999;background:#fafafa;border-bottom:1px solid #eee;gap:8px}.chat-notice>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-notice .quiet{font-size:11px;padding:5px 0}
.messages{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:20px 24px}.message{display:flex;flex-direction:column;align-items:flex-start;margin-bottom:20px}.message.mine{align-items:flex-end}.message .bubble{background:#fff;border:0;padding:11px 14px;border-radius:3px 12px 12px 12px;max-width:82%;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;font-size:15px}.message.mine .bubble{background:#ffed69;border-radius:12px 3px 12px 12px}.message time{font-size:10px;color:#aaa;margin-top:6px}.message img{display:block;max-width:100%;max-height:280px;border-radius:8px;cursor:pointer}.message .result{color:#aaa;font-size:10px;margin-top:4px;max-width:82%;overflow-wrap:anywhere}.message .result.uncertain{color:#e07c35}
.compose{flex-shrink:0;display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:end;gap:10px;background:#fafafa;padding:10px 18px calc(10px + env(safe-area-inset-bottom));border-top:1px solid #eaeaea}.compose textarea{display:block;resize:none;width:100%;border:0;border-radius:20px;background:#fff;padding:10px 14px;height:42px;min-height:42px;max-height:120px;line-height:22px;color:#222}.compose textarea::placeholder{color:#bbb}.image-picker{cursor:pointer;color:#555;font-size:27px;line-height:30px;width:30px;height:30px;border:1.5px solid #666;border-radius:50%;display:grid;place-items:center;margin-bottom:6px}.compose .primary{padding:11px 17px;min-height:42px;font-size:14px;white-space:nowrap}.attachment{flex-shrink:0;padding:8px 18px;background:#fff;display:flex;align-items:center;gap:12px;font-size:12px;color:#888}.attachment img{width:44px;height:44px;object-fit:cover;border-radius:8px}.empty-list{padding:40px 15px;text-align:center;color:#aaa;line-height:1.8;font-size:13px}#toast{position:fixed;bottom:90px;left:50%;transform:translateX(-50%);z-index:20;padding:12px 18px;border-radius:10px;background:#222e;color:white;max-width:90%;font-size:13px;box-shadow:0 4px 20px #0001}.image-error{color:#b78454;font-size:12px}
@media(max-width:700px){.workspace{display:block}.inbox{height:100%;border-right:0}.chat{display:none;height:100%}.workspace.in-chat .inbox{display:none}.workspace.in-chat .chat{display:block}.search-wrap{padding:8px 16px 6px}.tabs{padding:0 16px}.session{padding:14px 16px;min-height:82px}.session::after{left:78px;right:16px}.unread{left:52px}.chat-head{padding:8px 12px;gap:8px;min-height:60px}.chat-head .quiet{font-size:11px;padding:6px 9px}.chat-heading h2{font-size:16px}.back{display:block}.chat-notice{padding:4px 16px;font-size:10px}.chat-notice .quiet{font-size:10px}.messages{padding:18px 14px}.compose{padding:9px 12px calc(9px + env(safe-area-inset-bottom));gap:8px}.attachment{padding:8px 14px}.message .bubble{max-width:86%}.login-card h1{font-size:34px}}
/* Current product and buyer order detail views. */
.workspace{position:relative}.chat-heading p{display:none}.product-card{flex-shrink:0;display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:#fff;padding:8px 16px;border-bottom:1px solid var(--line);color:#222}.product-card>img,.product-placeholder{width:44px;height:44px;border-radius:9px;object-fit:cover;flex-shrink:0}.product-placeholder{display:grid;place-items:center;background:#fff7d7;color:#b29a55;font-size:12px}.product-copy{flex:1;min-width:0}.product-copy>strong{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:13px;line-height:1.5;font-weight:500}.product-meta{display:flex;align-items:center;gap:8px;margin-top:3px;min-width:0;flex-wrap:nowrap}.product-meta b{font-size:18px;color:#ff5149;flex-shrink:0}.product-meta>span{font-size:11px;color:#999;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.product-entry{font-size:11px;background:#fff4ab;padding:7px 10px;border-radius:18px;white-space:nowrap}.buyer-orders{position:absolute;inset:0;z-index:12;display:flex;flex-direction:column;background:#f5f5f5;min-height:0}.orders-head{display:flex;align-items:center;gap:12px;padding:12px 18px;background:#fff;flex-shrink:0;border-bottom:1px solid var(--line)}.orders-head .back{display:block}.orders-head>div{flex:1;min-width:0}.orders-head h2{font-size:16px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.orders-head p{font-size:11px;color:#999;margin:4px 0 0}.order-filters{display:flex;overflow-x:auto;gap:22px;padding:0 18px;background:#fff;flex-shrink:0;scrollbar-width:none}.order-filters button{position:relative;background:transparent;padding:14px 0;color:#888;font-size:13px;white-space:nowrap}.order-filters button.active{color:#222;font-weight:650}.order-filters button.active::after{position:absolute;content:"";height:3px;background:var(--yellow);width:22px;left:50%;transform:translateX(-50%);bottom:5px;border-radius:2px}.orders-list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:12px}.order-card{background:#fff;border-radius:12px;padding:14px;margin:0 auto 12px;max-width:760px}.order-card-top{display:flex;gap:12px;justify-content:space-between;align-items:center;font-size:10px;color:#999;padding-bottom:12px}.order-card-top strong{font-size:12px;color:#d39015;flex-shrink:0}.order-card-top>span{overflow-wrap:anywhere;text-align:right}.order-product{display:flex;gap:10px;align-items:flex-start;margin-bottom:14px}.order-product img{width:65px;height:65px;object-fit:cover;border-radius:8px;flex-shrink:0}.order-product>div{flex:1;min-width:0}.order-product h3{font-size:13px;font-weight:500;line-height:1.6;margin:0}.order-product p{color:#999;font-size:10px;margin:6px 0 0}.order-product>b{font-size:14px;white-space:nowrap}.order-field{display:flex;gap:12px;font-size:11px;line-height:1.8;margin:5px 0}.order-field>span:first-child{flex:0 0 56px;color:#999}.order-field>span:last-child{flex:1;min-width:0;overflow-wrap:anywhere;color:#555}.order-card details{border-top:1px solid #f3f3f3;padding-top:10px;margin-top:10px}.order-card summary{font-size:11px;color:#888;cursor:pointer;padding:2px 0 6px}.order-private{font-size:10px;color:#aaa;margin:7px 0}.orders-bottom{display:flex;justify-content:center;align-items:center;gap:10px;padding:8px 12px calc(8px + env(safe-area-inset-bottom));background:#fff;flex-shrink:0;font-size:11px;color:#999}.orders-bottom .quiet{font-size:12px;color:#806b15;background:#fff8cd}
@media(max-width:700px){.chat-head{min-height:50px}.product-card{padding:8px 14px;gap:9px}.product-card>img,.product-card>.product-placeholder{width:56px;height:56px}.product-entry{font-size:10px;padding:7px 8px}.product-copy>strong{font-size:12px}.product-meta b{font-size:17px}.product-meta>span{font-size:10px}.orders-head{padding:10px 12px}.order-filters{gap:20px;padding:0 14px}.orders-list{padding:10px}.order-card{padding:12px}}
.message .trade-bubble{min-width:min(260px,82vw);padding:14px 16px;background:#fff}.trade-message strong{font-size:14px;line-height:1.6;display:block}.trade-message p{font-size:12px;color:#999;line-height:1.65;border-top:1px solid #f0f0f0;padding-top:12px;margin:12px 0}.trade-order-entry{display:block;margin:12px 0 0 auto;background:var(--yellow);border-radius:18px;font-size:12px;color:#333;padding:7px 13px}

#mode.mode-auto{color:#209650}#mode.mode-human{color:#e5484d}#mode.mode-paused{color:#999}

.order-number{display:flex;align-items:center;justify-content:flex-end;gap:7px;min-width:0;color:#444;font-size:12px;font-weight:600}.order-number>span{overflow-wrap:anywhere}.order-copy{flex-shrink:0;padding:4px 7px;background:#fff7cf;color:#6d5b18;border-radius:5px;font-size:11px;font-weight:500;white-space:nowrap}.order-receiver{border-top:1px solid var(--line);padding-top:10px;margin-top:10px}.receiver-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#888;font-size:11px}.order-receiver>p{margin:6px 0 10px;font-size:12px;line-height:1.8;color:#444;white-space:pre-line;overflow-wrap:anywhere}.order-product p.order-specification{color:#555;font-size:12px;line-height:1.6;margin-top:5px}

.product-copy>#product-status{display:block;margin-top:2px;font-size:11px;line-height:1.4;color:#999}

.avatar{position:relative;overflow:hidden}.avatar>img.buyer-avatar{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:inherit}

.message.system-message{align-items:center;margin:12px 0 18px}.system-tip{max-width:90%;padding:5px 12px;border-radius:4px;background:#eaeaea;color:#999;font-size:12px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}

.session{color:#222;touch-action:manipulation;-webkit-appearance:none;appearance:none}@media(hover:hover) and (pointer:fine){.session:hover{background:#fffced}}
