:root{--background: #ffffff;--foreground: #09090b;--muted: #fafafa;--muted-2: #f4f4f5;--muted-foreground: #71717a;--subtle-foreground: #a1a1aa;--border: #e4e4e7;--border-strong: #d4d4d8;--primary: #18181b;--primary-foreground: #fafafa;--ring: #18181b;--destructive: #dc2626;--canvas: #f4f4f5;--radius: 8px;--radius-sm: 6px;--radius-lg: 10px;--shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .04);--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .07), 0 1px 2px -1px rgb(0 0 0 / .05);--shadow-md: 0 4px 12px -2px rgb(0 0 0 / .08), 0 2px 6px -2px rgb(0 0 0 / .05);--sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--mono: ui-monospace, SFMono-Regular, Menlo, monospace}*{box-sizing:border-box}body{margin:0;font-family:var(--sans);color:var(--foreground);background:var(--background);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;font-feature-settings:"cv11","ss01"}.app{display:flex;flex-direction:column;min-height:100vh}.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 20px;height:56px;background:var(--background);border-bottom:1px solid var(--border);flex-wrap:wrap}.topbar h1{font-size:14px;margin:0;font-weight:600;letter-spacing:-.01em}.topbar .tag{font-size:12.5px;color:var(--muted-foreground)}.topbar a{color:var(--muted-foreground);text-decoration:none;font-weight:500;font-size:13px}.topbar a:hover{color:var(--foreground)}.workbench{display:grid;grid-template-columns:minmax(440px,560px) 1fr;flex:1;min-height:0}@media (max-width: 900px){.workbench{grid-template-columns:1fr}}.editor{overflow-y:auto;padding:22px;background:var(--muted);border-right:1px solid var(--border);max-height:calc(100vh - 56px);display:flex;flex-direction:column;gap:16px}@media (max-width: 900px){.editor{max-height:none}}.preview{display:flex;flex-direction:column;background:var(--canvas);min-height:0}.card{background:var(--background);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-xs);overflow:hidden;flex:0 0 auto}.card-head{display:flex;align-items:center;gap:8px;padding:15px 18px;width:100%}.card-head h2{font-size:14.5px;font-weight:600;margin:0;letter-spacing:-.01em;color:var(--foreground)}.card-aside{margin-left:auto;font-size:12.5px;color:var(--muted-foreground);font-weight:400}.card-body{padding:0 18px 18px;display:grid;gap:14px}.collapsible .trigger{border:0;background:none;font:inherit;cursor:pointer;text-align:left}.collapsible .trigger:hover{background:var(--muted)}.collapsible .chevron{width:16px;height:16px;color:var(--subtle-foreground);transition:transform .18s ease;flex:none}.collapsible .card-aside+.chevron{margin-left:8px}.collapsible .trigger h2+.chevron{margin-left:auto}.collapsible.open .chevron{transform:rotate(180deg)}.collapsible.open .card-body{border-top:1px solid var(--border);padding-top:16px}.editor input,.editor select,.editor textarea{width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);font:inherit;font-size:14px;color:var(--foreground);background:var(--background);transition:border-color .12s,box-shadow .12s}.editor input::placeholder,.editor textarea::placeholder{color:var(--subtle-foreground)}.editor input:hover,.editor select:hover,.editor textarea:hover{border-color:var(--border-strong)}.editor input:focus,.editor select:focus,.editor textarea:focus{outline:none;border-color:var(--ring);box-shadow:0 0 0 3px #18181b14}.editor textarea{resize:vertical;min-height:46px;line-height:1.5}.editor select{cursor:pointer}.labeled{display:block;min-width:0}.labeled>span{display:block;font-size:12.5px;color:var(--muted-foreground);margin-bottom:6px;font-weight:500}.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px}.editor-toolbar{display:flex;align-items:center;gap:8px}.editor-toolbar select{flex:1;padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);font:inherit;font-size:14px;background:var(--background);color:var(--foreground);cursor:pointer}.editor-toolbar select:hover{border-color:var(--border-strong)}.party{min-width:0}.party-label{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted-foreground);font-weight:600;margin-bottom:7px}.party-name{margin-bottom:8px;font-weight:500}.party textarea{min-height:42px;font-size:13px;color:var(--muted-foreground)}.items{display:grid;gap:10px}.item{border:1px solid var(--border);border-radius:var(--radius);padding:12px;background:var(--muted)}.item-top{display:flex;gap:6px;align-items:center;margin-bottom:8px}.item-desc{flex:1;font-weight:500}.remove{border:1px solid transparent;background:none;color:var(--subtle-foreground);cursor:pointer;width:30px;height:30px;border-radius:var(--radius-sm);flex:none;display:grid;place-items:center;padding:0}.remove svg{width:15px;height:15px}.remove:hover{color:var(--destructive);background:var(--background);border-color:var(--border)}.item-controls{display:flex;align-items:center;gap:6px}.item-controls .num{flex:1;min-width:0;text-align:right;font-variant-numeric:tabular-nums}.item-controls .times{color:var(--subtle-foreground);font-size:12px;flex:none}.segmented{display:inline-flex;background:var(--muted-2);border-radius:var(--radius-sm);padding:3px;gap:2px;flex:none}.segmented button{border:0;background:transparent;padding:5px 11px;font:inherit;font-size:13px;font-weight:500;cursor:pointer;color:var(--muted-foreground);border-radius:4px;transition:background .12s,color .12s;white-space:nowrap}.segmented.sm button{padding:4px 10px;font-size:12.5px}.segmented button:hover{color:var(--foreground)}.segmented button.active{background:var(--background);color:var(--foreground);box-shadow:var(--shadow-xs)}.btn{border:1px solid var(--border);background:var(--background);border-radius:var(--radius-sm);padding:7px 13px;font:inherit;font-size:13px;font-weight:500;cursor:pointer;color:var(--foreground);transition:background .12s,border-color .12s;white-space:nowrap}.btn:hover{background:var(--muted-2)}.btn.sm{padding:6px 11px;font-size:12.5px}.btn.primary{background:var(--primary);color:var(--primary-foreground);border-color:var(--primary)}.btn.primary:hover{background:#27272a}.btn.accent{background:var(--primary);color:var(--primary-foreground);border-color:var(--primary)}.btn.ghost{border-color:transparent;background:transparent;color:var(--muted-foreground)}.btn.ghost:hover{background:var(--muted-2);color:var(--foreground)}.btn.dashed{border-style:dashed;color:var(--muted-foreground);background:transparent}.btn.dashed:hover{color:var(--foreground);border-color:var(--border-strong);background:var(--muted)}.btn.full{width:100%}.btn:disabled{opacity:.5;cursor:not-allowed}.btn-row{display:flex;gap:8px;flex-wrap:wrap}.tabbar{display:flex;align-items:center;gap:10px;padding:10px 16px;background:var(--background);border-bottom:1px solid var(--border);flex-wrap:wrap}.tabbar .modes{display:inline-flex;background:var(--muted-2);border-radius:var(--radius-sm);padding:3px;gap:2px}.tab{border:0;background:transparent;padding:5px 14px;font:inherit;font-size:13px;font-weight:500;cursor:pointer;color:var(--muted-foreground);border-radius:4px;transition:background .12s,color .12s}.tab:hover{color:var(--foreground)}.tab.active{background:var(--background);color:var(--foreground);box-shadow:var(--shadow-xs)}.tab-note{font-size:12.5px;color:var(--subtle-foreground)}.spacer{flex:1}.stage{flex:1;overflow:auto;padding:24px;display:flex;justify-content:center;min-height:0}.frame{background:#fff;border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-md);width:100%;max-width:720px;height:100%;min-height:600px}.frame.email,.frame.web{max-width:680px}.frame.document{max-width:760px}.error-banner{margin:16px 20px;padding:12px 14px;border:1px solid #fecaca;background:#fef2f2;color:#b91c1c;border-radius:var(--radius);font-family:var(--mono);font-size:12px}.ai-box{display:grid;gap:12px}.ai-box .hint{font-size:12px;color:var(--muted-foreground);margin:0;line-height:1.5}.ai-status{font-size:12.5px;margin:0}.ai-status.err{color:var(--destructive)}.ai-status.ok{color:#15803d}.toast{position:fixed;bottom:20px;left:50%;transform:translate(-50%);background:var(--primary);color:var(--primary-foreground);padding:9px 16px;border-radius:var(--radius);font-size:13px;font-weight:500;box-shadow:var(--shadow-md);z-index:50}
