* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #222; min-height: 100vh; padding: 20px; }
.container { max-width: 1500px; margin: 0 auto; }
header { background: white; border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
h1 { text-align: center; color: #1a5490; margin-bottom: 15px; }
.tabs { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.tab { padding: 10px 20px; border: none; background: #f0f2f5; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.2s; }
.tab:hover { background: #e0e4ea; }
.tab.active { background: #1a5490; color: white; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
.panel { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.panel h2 { font-size: 17px; margin-bottom: 15px; color: #1a5490; border-bottom: 2px solid #eef4fb; padding-bottom: 8px; }
.preset-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-btn { padding: 12px 8px; background: #eef4fb; border: 2px solid transparent; border-radius: 8px; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.preset-btn:hover { border-color: #1a5490; background: #dce8f5; }
.input-group { margin-bottom: 12px; }
.input-group label { display: block; margin-bottom: 5px; font-size: 13px; color: #555; font-weight: 500; }
.row { display: flex; align-items: center; gap: 6px; }
input[type="number"], input[type="text"], select { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
input:focus, select:focus { outline: none; border-color: #1a5490; box-shadow: 0 0 0 3px rgba(26,84,144,0.1); }
.checkbox-group { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.checkbox-group label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn, .btn-primary { flex: 1; padding: 10px; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; transition: all 0.2s; font-weight: 500; }
.btn { background: #eef4fb; color: #1a5490; }
.btn:hover { background: #dce8f5; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #1a5490; color: white; }
.btn-primary:hover { background: #144070; }
.stats { padding: 12px; background: #eef4fb; border-radius: 6px; font-size: 14px; line-height: 1.7; }
.stats strong { color: #1a5490; }
.parts-list { max-height: 400px; overflow-y: auto; font-size: 13px; }
.part-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid #eee; }
.part-item:hover { background: #f9f9f9; }
.color-dot { width: 16px; height: 16px; border-radius: 3px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.1); }
.part-name { flex: 1; }
.part-dims { color: #777; font-size: 12px; }
.delete-btn { background: #fee; color: #c33; border: none; border-radius: 4px; padding: 3px 8px; cursor: pointer; font-size: 12px; }
.canvas-wrap { background: #fafafa; border: 1px solid #ddd; border-radius: 8px; overflow: auto; max-height: 700px; }
canvas { display: block; background: white; }
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; justify-content: center; align-items: center; }
.modal.active { display: flex; }
.modal-content { background: white; padding: 25px; border-radius: 12px; width: 90%; max-width: 400px; }
.modal-content h3 { margin-bottom: 15px; color: #1a5490; }

/* Смета */
.cost-report { display: flex; flex-direction: column; gap: 20px; }
.cost-section { background: #f9fafb; border-radius: 8px; padding: 15px; border: 1px solid #e5e7eb; }
.cost-section h4 { margin: 0 0 10px 0; color: #1a5490; font-size: 15px; }
.cost-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #e5e7eb; font-size: 14px; }
.cost-row:last-child { border-bottom: none; }
.cost-row.total { margin-top: 10px; padding-top: 10px; border-top: 2px solid #1a5490; font-size: 18px; color: #1a5490; }
.cost-row.total strong { color: #c33; font-size: 22px; }

/* Голос */
#voiceBtn { width: 44px; height: 44px; font-size: 20px; flex-shrink: 0; transition: all 0.2s; }
#voiceBtn.listening { background: #E74C3C; color: white; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes slideIn { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Чат */
.chat-box { height: 400px; overflow-y: auto; border: 1px solid #ddd; border-radius: 8px; padding: 15px; margin-bottom: 15px; background: #fafafa; }
.msg { margin-bottom: 15px; padding: 10px 15px; border-radius: 8px; max-width: 80%; }
.msg.user { background: #4A90E2; color: white; margin-left: auto; }
.msg.assistant { background: #eef4fb; color: #333; }
.msg-role { font-size: 12px; opacity: 0.8; margin-bottom: 5px; }
.chat-input { display: flex; gap: 10px; }
.chat-input input { flex: 1; }

/* Текстуры */
.texture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 15px; }
.texture-card { border: 2px solid #ddd; border-radius: 8px; overflow: hidden; cursor: pointer; transition: all 0.2s; }
.texture-card:hover { border-color: #4A90E2; transform: translateY(-2px); }
.texture-card.active { border-color: #4A90E2; box-shadow: 0 0 0 3px rgba(74,144,226,0.3); }
.texture-card img { width: 100%; height: 80px; object-fit: cover; }
.texture-info { padding: 8px; font-size: 12px; }
.texture-name { font-weight: 600; margin-bottom: 3px; }
.texture-dir { color: #777; }

/* Подсказки */
.hint-list { display: flex; flex-direction: column; gap: 8px; }
.hint-item { padding: 10px; background: #eef4fb; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.hint-item:hover { background: #dce8f5; transform: translateX(5px); }

@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
