:root{--bg: #0a0a0b;--bg-2: #101012;--surface: #16161a;--surface-2: #1e1e23;--surface-3: #26262c;--border: #26262b;--border-2: #35353d;--text: #ededf0;--text-2: #b6b6c0;--muted: #7d7d88;--accent: #ff6b4a;--accent-2: #ffb35c;--accent-soft: rgba(255, 107, 74, .14);--ok: #3ecf8e;--err: #ff5f56;--radius: 14px;--radius-sm: 10px;--tap: 40px;--safe-b: env(safe-area-inset-bottom, 0px);--safe-t: env(safe-area-inset-top, 0px);color-scheme:dark}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body,#root{height:100%}body{margin:0;background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji";overscroll-behavior-y:none}button,input,textarea,select{font:inherit;color:inherit}button{background:none;border:0;cursor:pointer;padding:0}input,textarea,select{width:100%;background:var(--bg-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:9px 11px;outline:none;transition:border-color .15s,background .15s}input:focus,textarea:focus,select:focus{border-color:var(--accent);background:var(--surface)}textarea{resize:vertical;min-height:72px;line-height:1.45}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:var(--surface-3);border-radius:8px}.app{display:flex;flex-direction:column;height:100dvh;max-width:780px;margin:0 auto;border-inline:1px solid var(--border)}@media(max-width:800px){.app{border:0}}.topbar{display:flex;align-items:center;gap:8px;padding:calc(var(--safe-t) + 8px) 10px 8px;border-bottom:1px solid var(--border);background:var(--bg);position:sticky;top:0;z-index:20}.workspace{flex:1;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch}.bottombar{border-top:1px solid var(--border);background:var(--bg);padding-bottom:var(--safe-b);position:sticky;bottom:0;z-index:20}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:var(--tap);padding:0 13px;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--border);color:var(--text);white-space:nowrap;transition:background .14s,border-color .14s,opacity .14s}.btn:active{background:var(--surface-3)}.btn:disabled{opacity:.45;pointer-events:none}.btn.primary{background:linear-gradient(180deg,var(--accent-2),var(--accent));border-color:transparent;color:#17110c;font-weight:640}.btn.ghost{background:transparent;border-color:transparent}.btn.ghost:active{background:var(--surface-2)}.btn.danger{color:var(--err);border-color:#ff5f564d}.btn.sm{min-height:32px;padding:0 10px;font-size:13px;border-radius:9px}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:var(--tap);height:var(--tap);flex:0 0 auto;border-radius:var(--radius-sm);color:var(--text-2);transition:background .14s,color .14s}.icon-btn:active,.icon-btn.on{background:var(--surface-2);color:var(--text)}.icon-btn.on{color:var(--accent);background:var(--accent-soft)}.chip{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 11px;border-radius:999px;background:var(--surface-2);border:1px solid var(--border);color:var(--text-2);font-size:13px;white-space:nowrap;transition:background .14s,color .14s,border-color .14s}.chip.on{background:var(--accent-soft);border-color:#ff6b4a66;color:var(--accent-2)}.chip:active{background:var(--surface-3)}.row{display:flex;align-items:center;gap:8px}.row.wrap{flex-wrap:wrap}.scroller{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:6px 10px}.scroller::-webkit-scrollbar{display:none}.spacer{flex:1}.muted{color:var(--muted)}.small{font-size:12.5px}.field{display:block;margin-bottom:14px}.field>span{display:block;font-size:12.5px;color:var(--muted);margin-bottom:5px}.field .hint{font-size:11.5px;color:var(--muted);margin-top:4px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px}.section-title{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:18px 0 8px}.spin{animation:spin .9s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.project-chip{display:flex;align-items:center;gap:7px;min-height:var(--tap);padding:0 12px;border-radius:var(--radius-sm);background:var(--surface);border:1px solid var(--border);max-width:55vw}.project-chip b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.counter{font-variant-numeric:tabular-nums;font-size:12px;color:var(--muted);text-align:right;line-height:1.25}.counter b{color:var(--text-2);font-weight:600}.counter.over b{color:var(--err)}.editor-wrap{padding:4px 14px 10px}.ProseMirror{outline:none;min-height:34vh;font-size:16px;line-height:1.62;word-break:break-word}.ProseMirror p{margin:0 0 .85em}.ProseMirror>*:last-child{margin-bottom:0}.ProseMirror h1,.ProseMirror h2,.ProseMirror h3{margin:1em 0 .4em;line-height:1.25}.ProseMirror h1{font-size:1.35em}.ProseMirror h2{font-size:1.2em}.ProseMirror h3{font-size:1.08em}.ProseMirror ul,.ProseMirror ol{padding-left:1.25em;margin:0 0 .85em}.ProseMirror li{margin:.15em 0}.ProseMirror blockquote{margin:0 0 .85em;padding:2px 0 2px 12px;border-left:3px solid var(--accent);color:var(--text-2)}.ProseMirror blockquote[data-expandable=true]{border-left-style:dashed}.ProseMirror code{background:var(--surface-2);border:1px solid var(--border);border-radius:5px;padding:1px 5px;font-size:.9em;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.ProseMirror pre{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 12px;overflow-x:auto;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13.5px}.ProseMirror pre code{background:none;border:0;padding:0}.ProseMirror a{color:var(--accent-2);text-underline-offset:2px}.ProseMirror hr{border:0;border-top:1px solid var(--border-2);margin:1.2em 0}.ProseMirror .tg-spoiler{background:var(--surface-3);border-radius:4px;color:var(--text-2);box-shadow:inset 0 0 0 1px var(--border-2);padding:0 2px}.ProseMirror p.is-editor-empty:first-child:before{content:attr(data-placeholder);float:left;height:0;color:var(--muted);pointer-events:none}.ProseMirror ::selection{background:#ff6b4a47}.images{padding:0 14px 16px}.image-card{position:relative;border-radius:var(--radius);overflow:hidden;border:1px solid var(--border);background:var(--surface);margin-bottom:10px}.image-card img{display:block;width:100%;max-height:62vh;object-fit:contain;background:#000}.image-card .bar{display:flex;align-items:center;gap:4px;padding:6px;border-top:1px solid var(--border);overflow-x:auto;scrollbar-width:none}.image-card .bar::-webkit-scrollbar{display:none}.image-meta{font-size:11px;color:var(--muted);padding:0 8px 6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fmt-row{border-bottom:1px solid var(--border)}.fmt-row .icon-btn{width:36px;height:36px}.ai-row .chip{height:34px}.model-row{display:flex;align-items:center;gap:8px;padding:6px 10px 8px}.model-btn{display:flex;align-items:center;gap:6px;height:34px;padding:0 10px;border-radius:999px;border:1px solid var(--border);background:var(--surface);font-size:12.5px;color:var(--text-2);max-width:46vw;overflow:hidden}.model-btn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overlay{position:fixed;inset:0;background:#0000009e;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);z-index:60;display:flex;align-items:flex-end;justify-content:center;animation:fade .16s ease}@keyframes fade{0%{opacity:0}}.sheet{width:100%;max-width:780px;max-height:88dvh;display:flex;flex-direction:column;background:var(--bg-2);border:1px solid var(--border);border-bottom:0;border-radius:18px 18px 0 0;animation:rise .2s cubic-bezier(.2,.8,.2,1);padding-bottom:var(--safe-b)}@keyframes rise{0%{transform:translateY(18px);opacity:.4}}.sheet-head{display:flex;align-items:center;gap:8px;padding:12px 12px 10px;border-bottom:1px solid var(--border)}.sheet-head h2{margin:0;font-size:15px;font-weight:620}.sheet-body{overflow-y:auto;padding:12px}.sheet-foot{border-top:1px solid var(--border);padding:10px 12px;display:flex;gap:8px}.list-item{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:10px 11px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--surface);margin-bottom:8px}.list-item.on{border-color:var(--accent);background:var(--accent-soft)}.list-item .t{flex:1;min-width:0}.list-item .t b{display:block;font-weight:580;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.list-item .t small{display:block;color:var(--muted);font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.star{color:var(--muted)}.star.on{color:var(--accent-2)}.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px}.tile{position:relative;aspect-ratio:1;border-radius:var(--radius-sm);overflow:hidden;border:1px solid var(--border);background:var(--surface)}.tile img{width:100%;height:100%;object-fit:cover;display:block}.tile .tag{position:absolute;left:4px;bottom:4px;font-size:9.5px;padding:2px 5px;border-radius:5px;background:#000000a8;color:var(--text-2)}.tile .x{position:absolute;right:3px;top:3px;width:24px;height:24px;display:grid;place-items:center;border-radius:7px;background:#0000009e;color:#fff}.emoji-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(40px,1fr));gap:2px}.emoji-grid button{height:40px;font-size:23px;border-radius:8px;line-height:1}.emoji-grid button:active{background:var(--surface-2)}.crop-stage{position:relative;width:100%;height:52dvh;background:#000}.reactEasyCrop_CropArea{border:1px solid rgba(255,255,255,.7)!important;box-shadow:0 0 0 9999em #0000009e!important}.stat{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:11px 12px}.stat b{display:block;font-size:20px;font-variant-numeric:tabular-nums;font-weight:620}.stat span{font-size:11.5px;color:var(--muted)}.bar-row{display:flex;align-items:center;gap:8px;margin-bottom:7px;font-size:12.5px}.bar-row .name{flex:0 0 42%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-2)}.bar-row .track{flex:1;height:6px;border-radius:4px;background:var(--surface-2);overflow:hidden}.bar-row .fill{height:100%;background:linear-gradient(90deg,var(--accent),var(--accent-2))}.bar-row .val{font-variant-numeric:tabular-nums;color:var(--muted);min-width:62px;text-align:right}.toasts{position:fixed;left:50%;transform:translate(-50%);bottom:calc(var(--safe-b) + 88px);z-index:90;display:flex;flex-direction:column;gap:7px;width:min(94vw,520px);pointer-events:none}.toast{pointer-events:auto;padding:10px 13px;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--border-2);font-size:13.5px;box-shadow:0 10px 28px #00000080;animation:rise .18s ease}.toast.ok{border-color:#3ecf8e73}.toast.err{border-color:#ff5f5680;color:#ffd9d6}.empty{text-align:center;color:var(--muted);padding:34px 12px;font-size:13.5px}.busy-bar{height:2px;background:linear-gradient(90deg,transparent,var(--accent),transparent);background-size:40% 100%;animation:slide 1.1s linear infinite}@keyframes slide{0%{background-position:-60% 0}to{background-position:160% 0}}.seg{display:flex;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:3px;gap:3px}.seg button{flex:1;height:32px;border-radius:8px;font-size:13px;color:var(--text-2)}.seg button.on{background:var(--surface-3);color:var(--text)}
