/* ── Recipe Assistant Widget ────────────────────────────────────────────── */

#ra-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* Floating action button */
#ra-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px;
  border-radius: 24px;
  background: #cba549;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
#ra-fab:hover { background: #a8893b; transform: scale(1.03); }
#ra-fab:focus-visible { outline: 3px solid #dfc070; outline-offset: 2px; }
#ra-fab-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Panel */
#ra-panel[hidden] { display: none; }
#ra-panel {
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 340px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
#ra-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #cba549;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}
#ra-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.85;
}
#ra-close:hover { opacity: 1; }

/* Step reader */
#ra-steps {
  padding: 12px 14px;
  background: #fdf8ee;
  border-bottom: 1px solid #e8d48a;
  flex-shrink: 0;
}
#ra-step-text {
  font-size: 13.5px;
  color: #1c1917;
  margin-bottom: 10px;
  line-height: 1.55;
}
#ra-step-btns {
  display: flex;
  gap: 8px;
}
#ra-step-btns button {
  flex: 1;
  padding: 6px 0;
  border: 1px solid #cba549;
  border-radius: 8px;
  background: #fff;
  color: #6b5520;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
#ra-step-btns button:hover { background: #faf2d8; }
#ra-read { background: #faf2d8 !important; }

/* Messages */
#ra-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ra-msg {
  max-width: 90%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
}
.ra-user {
  align-self: flex-end;
  background: #cba549;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ra-assistant {
  align-self: flex-start;
  background: #f4f4f5;
  color: #1c1917;
  border-bottom-left-radius: 4px;
}

/* Input row */
#ra-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #e4e4e7;
  background: #fff;
  flex-shrink: 0;
}
#ra-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  color: #1c1917;
  background: #fafafa;
}
#ra-input:focus { border-color: #cba549; background: #fff; }
#ra-send {
  padding: 8px 14px;
  background: #cba549;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
#ra-send:hover { background: #a8893b; }

/* Mobile */
@media (max-width: 420px) {
  #ra-panel {
    width: calc(100vw - 32px);
    right: -8px;
  }
}
