/* General Layout - aligned with other services */
:root {
  --bg-main: #f8f9fa;
  --bg-panel: #ffffff;
  --text-main: #212529;
  --text-light: #6c757d;
  --border-color: #dee2e6;
  --accent-color: #4CAF50;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
}

.layout { display: flex; height: 100vh; }

/* Chat Panel */
.chat-panel {
  width: 35%;
  max-width: 420px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}
.chat-header { padding: 1rem; font-weight: 600; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; }
.chat-header .dot { width: 8px; height: 8px; background-color: #2abf88; border-radius: 50%; margin-right: 8px; }
.messages { flex-grow: 1; padding: 1rem; overflow-y: auto; }
.msg { padding: 0.75rem 1rem; border-radius: 18px; margin-bottom: 0.75rem; max-width: 85%; line-height: 1.5; }
.msg.me { background-color: var(--accent-color); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.ai { background-color: #e9ecef; color: var(--text-main); align-self: flex-start; border-bottom-left-radius: 4px; }
.composer { display: flex; padding: 1rem; border-top: 1px solid var(--border-color); }
.composer textarea { flex-grow: 1; border: 1px solid var(--border-color); border-radius: 12px; padding: 0.6rem 0.9rem; font-family: var(--font-main); font-size: 1rem; resize: none; }
.composer button { background: var(--accent-color); color: white; border: none; border-radius: 20px; padding: 0.75rem 1.5rem; margin-left: 0.5rem; font-weight: 500; cursor: pointer; }

/* Initial choices */
.initial-choices { padding: 1rem; border-top: 1px solid var(--border-color); }
.choice-button { display: block; width: 68%; max-width: 260px; padding: 0.7rem 0.9rem; margin: 0.3rem auto; background-color: #e9ecef; border: 1px solid var(--border-color); border-radius: 8px; text-align: center; font-family: var(--font-main); font-size: 1rem; line-height: 1.3; white-space: normal; word-break: break-word; min-height: 2.8rem; font-weight: 500; cursor: pointer; transition: background-color 0.2s, border-color 0.2s; }
.choice-button:hover { background-color: #dee2e6; border-color: #adb5bd; }

/* Preview Panel */
.preview-panel { flex-grow: 1; padding: 2rem; display: flex; justify-content: center; align-items: center; }
.card { width: 100%; max-width: 900px; background: var(--bg-panel); border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.08); padding: 2rem; transition: all 0.3s ease; }
.card.is-blank { text-align: center; color: var(--text-light); }
.title { text-align: center; margin-top: 0; font-weight: 700; font-size: 1.75rem; line-height: 1.3; word-break: break-word; overflow-wrap: anywhere; }
.card-content-wrapper { margin-top: 2rem; }

/* Builder specific */
.builder-panel { width: 100%; min-height: 340px; display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
.robot-placeholder p { font-size: 3.6rem; margin: 0; }
.robot-placeholder { color: var(--text-light); display: flex; flex-direction: column; align-items: center; gap: 8px; }

.parts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.part-card { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; background: #fff; }
.part-card h4 { margin: 0 0 8px; font-size: 1rem; }
.part-options { display: flex; flex-direction: column; gap: 6px; }
.part-option { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid #edf2f7; border-radius: 8px; cursor: pointer; }
.part-option:hover { background: #f8f9fa; }
.part-option input { margin-right: 8px; }

.summary { border-top: 1px dashed var(--border-color); padding-top: 12px; color: var(--text-light); font-size: 0.95rem; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #e8f5e9; color: #2e7d32; }
.badge.warn { background: #fff3e0; color: #e65100; }
.badge.err { background: #ffebee; color: #b71c1c; }

.budget { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.budget input { width: 140px; padding: 6px 8px; border: 1px solid var(--border-color); border-radius: 8px; }

.score { display: flex; gap: 8px; align-items: center; }
.score-bar { flex: 1; height: 8px; background: #e9ecef; border-radius: 999px; overflow: hidden; }
.score-bar > span { display: block; height: 100%; width: 0%; background: var(--accent-color); transition: width 0.3s ease; }

.legend { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-light); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; display: inline-block; border-radius: 2px; }
.legend .cpu { background: #9c27b0; }
.legend .gpu { background: #1976d2; }
.legend .monitor { background: #8e24aa; }
.legend .ram { background: #388e3c; }
.legend .storage { background: #795548; }
.legend .psu { background: #455a64; }
.legend .overall { background: var(--accent-color); } 