:root{--tg-bg: #ffffff;--tg-header-bg: #517da2;--tg-chat-bg: #7fb0d8;--tg-user-msg: #effdde;--tg-bot-msg: #ffffff;--tg-text: #000000;--tg-secondary: #697680;--tg-border: #dadce0;--tg-btn-bg: #3390ec;--tg-btn-text: #ffffff;--surface-0: #ffffff;--surface-1: #f8f9fa;--surface-2: #eef1f5;--surface-border: #dadce0;--text-primary: #000000;--text-secondary: #697680;--text-muted: #888888;--shadow-sm: 0 1px 2px rgba(0,0,0,.1);--overlay-bg: rgba(0,0,0,.5)}body.dark{--tg-bg: #1c2733;--tg-header-bg: #0e1621;--tg-chat-bg: #0e1621;--tg-user-msg: #2b5278;--tg-bot-msg: #182533;--tg-text: #e9edef;--tg-secondary: #708499;--tg-border: #2a3a4a;--tg-btn-bg: #5288c1;--tg-btn-text: #ffffff;--surface-0: #182533;--surface-1: #1f2c39;--surface-2: #2a3a4a;--surface-border: #2a3a4a;--text-primary: #e9edef;--text-secondary: #708499;--text-muted: #6a7a89;--shadow-sm: 0 1px 2px rgba(0,0,0,.4);--overlay-bg: rgba(0,0,0,.7)}*{box-sizing:border-box;margin:0;padding:0}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--tg-bg);color:var(--text-primary)}.auth-screen{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100vh;padding:20px;background:linear-gradient(135deg,#517da2,#3a6b8c)}body.dark .auth-screen{background:linear-gradient(135deg,#0e1621,#1c2733)}.auth-box{background:var(--surface-0);padding:30px;border-radius:12px;box-shadow:0 4px 12px #0003;width:100%;max-width:320px}.auth-box h2{margin-bottom:20px;color:var(--text-primary);text-align:center}.auth-btn{background:#ffffff26;border:1px solid rgba(255,255,255,.3);color:#fff;padding:8px 16px;border-radius:8px;cursor:pointer;font-size:14px;font-weight:500;transition:background .2s}.auth-btn:hover{background:#ffffff40}.login-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:var(--overlay-bg);display:flex;align-items:center;justify-content:center;z-index:1000;animation:fadeIn .2s ease-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.login-modal{background:var(--surface-0);padding:30px;border-radius:16px;box-shadow:0 10px 40px #0000004d;width:90%;max-width:380px;animation:slideUp .3s ease-out}@keyframes slideUp{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}.login-modal h2{margin-bottom:8px;color:var(--text-primary);text-align:center}.login-hint{color:var(--text-secondary);font-size:13px;text-align:center;margin-bottom:20px}.close-modal-btn{width:100%;padding:10px;margin-top:12px;background:transparent;color:var(--text-secondary);border:1px solid var(--surface-border);border-radius:8px;cursor:pointer;font-size:14px;transition:background .2s}.close-modal-btn:hover{background:var(--surface-2)}.input{width:100%;padding:12px;margin:10px 0;border:1px solid var(--surface-border);border-radius:8px;font-size:16px;background:var(--surface-0);color:var(--text-primary)}.input::placeholder{color:var(--text-muted)}.btn{width:100%;padding:12px;margin-top:10px;background:var(--tg-btn-bg);color:var(--tg-btn-text);border:none;border-radius:8px;font-size:16px;cursor:pointer}.btn:disabled{opacity:.6;cursor:not-allowed}.error{color:#d32f2f;font-size:14px;margin-top:8px;text-align:center}.chat-container{display:flex;flex-direction:column;height:100vh;background:var(--tg-chat-bg)}.chat-header{background:var(--tg-header-bg);color:#fff;padding:15px;display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;z-index:10}.chat-header h1{font-size:18px;font-weight:600}.logout-btn{background:#fff3;border:none;color:#fff;padding:6px 12px;border-radius:6px;cursor:pointer}.theme-toggle{background:#ffffff26;border:1px solid rgba(255,255,255,.3);color:#fff;padding:8px 12px;border-radius:8px;cursor:pointer;font-size:16px;transition:background .2s;margin-right:8px}.theme-toggle:hover{background:#ffffff40}.lang-toggle{background:#ffffff26;border:1px solid rgba(255,255,255,.3);color:#fff;padding:8px 12px;border-radius:8px;cursor:pointer;font-size:13px;font-weight:600;transition:background .2s;margin-right:8px;min-width:70px}.lang-toggle:hover{background:#ffffff40}.messages{flex:1;overflow-x:hidden;overflow-y:auto;padding:15px;display:flex;flex-direction:column;gap:10px}.message{max-width:85%;padding:10px 14px;border-radius:12px;font-size:15px;line-height:1.4;position:relative;word-wrap:break-word;color:var(--text-primary)}.message.user{align-self:flex-end;background:var(--tg-user-msg);border-bottom-right-radius:4px}.message.bot{align-self:flex-start;background:var(--tg-bot-msg);border-bottom-left-radius:4px;box-shadow:var(--shadow-sm)}.message img{max-width:480px;width:100%;height:auto;border-radius:8px;margin-top:8px;display:block}.product-info{background:var(--surface-1);padding:10px;border-radius:8px;margin-top:8px;font-size:14px;color:var(--text-primary)}.product-info div{margin:4px 0}.product-info strong{color:var(--text-primary)}.instruction-row{margin-top:8px;padding-top:8px;border-top:1px dashed var(--surface-border)}.instruction-link{display:inline-block;background:var(--tg-btn-bg);color:var(--tg-btn-text);text-decoration:none;padding:8px 14px;border-radius:8px;font-size:13px;font-weight:600;transition:opacity .2s}.instruction-link:hover{opacity:.85}.instruction-placeholder{display:inline-block;color:var(--text-muted);font-size:13px;font-style:italic;padding:6px 0}.price-row{display:flex;justify-content:space-between;align-items:center;margin-top:8px;padding-top:8px;border-top:1px solid var(--surface-border);font-weight:600}.compact-product-list{display:flex;flex-direction:column;margin-top:6px;gap:0}.compact-product-row{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:auto auto;column-gap:8px;row-gap:2px;align-items:baseline;padding:6px 0;border-bottom:1px dashed var(--surface-border);font-size:13px;color:var(--text-primary)}.compact-product-row:last-child{border-bottom:none}.compact-num{grid-row:1 / 3;grid-column:1;color:var(--text-muted);font-weight:600;min-width:22px}.compact-name{grid-row:1;grid-column:2;font-weight:500}.compact-price{grid-row:1;grid-column:3;font-weight:600;white-space:nowrap;color:var(--text-primary)}.compact-power{grid-row:2;grid-column:2 / 4;font-size:12px;color:var(--text-muted)}@media (max-width: 670px){.messages{padding:10px}.message{max-width:92%;font-size:14px}.message img{max-width:240px}.chat-header{padding:10px 12px;flex-wrap:wrap;gap:6px}.chat-header h1{font-size:16px}.auth-btn,.theme-toggle,.lang-toggle{padding:6px 10px;font-size:13px}.inline-btn{font-size:13px;padding:7px 10px}.compact-product-row{font-size:12px}.compact-power{font-size:11px}}.discount-price{color:#ef5350;font-size:18px;font-weight:700}.regular-price{color:var(--text-primary);font-size:15px}.regular-price.strikethrough{color:var(--text-muted);text-decoration:line-through;font-size:14px}.discount-badge{background:#d32f2f;color:#fff;padding:4px 10px;border-radius:12px;font-size:11px;font-weight:600;animation:pulse 2s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.7}}.buttons-container{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.inline-btn{background:var(--surface-2);color:var(--tg-btn-bg);border:1px solid var(--tg-btn-bg);padding:8px 12px;border-radius:8px;cursor:pointer;font-size:14px;font-weight:500}.inline-btn:active{background:var(--tg-btn-bg);color:var(--tg-btn-text)}.input-area{background:var(--surface-0);padding:10px;border-top:1px solid var(--tg-border);display:flex;gap:10px}.input-area input{flex:1;padding:10px;border:1px solid var(--surface-border);border-radius:20px;outline:none;background:var(--surface-0);color:var(--text-primary)}.send-btn{background:var(--tg-btn-bg);color:var(--tg-btn-text);border:none;width:40px;height:40px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center}.admin-panel{background:var(--surface-1);border-bottom:2px solid var(--surface-border);padding:12px;max-height:50vh;overflow-y:auto;color:var(--text-primary)}.admin-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.admin-header h2{font-size:16px;margin:0}.admin-tabs{display:flex;gap:6px}.admin-tabs button{padding:6px 14px;border-radius:6px;border:1px solid var(--surface-border);background:var(--surface-0);cursor:pointer;font-size:13px;color:var(--text-primary)}.admin-tabs button.active{background:var(--tg-btn-bg);color:var(--tg-btn-text);border-color:var(--tg-btn-bg)}.close-admin-btn{background:none;border:none;font-size:18px;cursor:pointer;color:var(--text-secondary);padding:4px 8px}.close-admin-btn:hover{color:#d32f2f}.admin-error{background:#ffebee;color:#d32f2f;padding:8px 12px;border-radius:6px;margin-bottom:10px;font-size:13px}body.dark .admin-error{background:#4a1f1f;color:#ff8a80}.admin-list{margin-bottom:12px}.btn-sm{padding:4px 10px;font-size:12px;border-radius:6px;border:1px solid var(--surface-border);background:var(--surface-0);color:var(--text-primary);cursor:pointer}.btn-sm:hover{background:var(--surface-2)}.btn-edit{color:var(--tg-btn-bg);border-color:var(--tg-btn-bg)}.btn-delete{color:#d32f2f;border-color:#d32f2f}.node-tree{display:flex;flex-direction:column;gap:6px}.node-item{display:flex;justify-content:space-between;align-items:center;background:var(--surface-0);padding:8px 12px;border-radius:8px;border:1px solid var(--surface-border);color:var(--text-primary)}.node-info{display:flex;align-items:center;gap:8px}.node-icon{font-size:16px}.node-name{font-weight:500;font-size:14px}.node-type-badge{font-size:11px;background:#e3f2fd;color:#1976d2;padding:2px 6px;border-radius:4px}body.dark .node-type-badge{background:#1e3a5f;color:#82b1ff}.node-id-badge{font-size:11px;background:#f3e5f5;color:#7b1fa2;padding:2px 6px;border-radius:4px;font-family:monospace}body.dark .node-id-badge{background:#3a1f4a;color:#ce93d8}.node-parent-badge{font-size:11px;background:#fff3e0;color:#e65100;padding:2px 6px;border-radius:4px;font-family:monospace}body.dark .node-parent-badge{background:#4a2a0e;color:#ffb74d}.node-actions{display:flex;gap:4px}.admin-form{display:flex;flex-direction:column;gap:8px}.admin-form h3{font-size:15px;margin:0 0 4px;color:var(--text-primary)}.admin-form h4{font-size:14px;margin:12px 0 6px;color:var(--text-secondary)}.form-row{display:flex;flex-direction:column;gap:2px}.form-row label{font-size:13px;font-weight:500;color:var(--text-primary)}.form-row small{font-size:11px;color:var(--text-muted)}.form-row.wide textarea,.form-row.wide input{width:100%}.admin-form .btn{width:auto;padding:8px 20px;margin-top:4px}.admin-form .btn-secondary{background:var(--surface-2);color:var(--text-primary)}
